cvs commit: src/sys/kern uipc_syscalls.c

Jacques A. Vidrine nectar at FreeBSD.org
Sun Jan 11 07:35:24 PST 2004


On Sat, Jan 10, 2004 at 02:31:42PM -0800, Don Lewis wrote:
> BTW, I think a better solution is for getsockaddr() to call an address
> family specific length checker before returning, and to remove the
> sa_len check from all the consumers.  With the commit I did to the tcp
> code after this commit, sa_len is checked three times for the bind() and
> connect() syscalls.  I wasn't feeling that ambitious, though.

I agree, that's sounds like a good TODO item.

> It looks like the AF_UNIX implementation allows the length to be shorter
> than sizeof(*sa).  It appears that you don't have to pass in the full
> 104 character sun_path.

That's correct.  I believe that's not a well-defined area... I
think some platforms actually require that sun_len == sizeof(struct
sockaddr_un), while others do not.  I seem to recall trying to put
together a definitive answer based on Stevens' writings and available
standards.  I think at best one should use the SUN_LEN macro where
availble, or else use the full size.  (Sorry, drifting from the
subject.)

Cheers,
--
Jacques Vidrine   NTT/Verio SME      FreeBSD UNIX       Heimdal
nectar at celabo.org jvidrine at verio.net nectar at freebsd.org nectar at kth.se


More information about the cvs-src mailing list