Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jan 2004 09:35:20 -0600
From:      "Jacques A. Vidrine" <nectar@FreeBSD.org>
To:        Don Lewis <truckman@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern uipc_syscalls.c
Message-ID:  <20040111153520.GA89683@madman.celabo.org>
In-Reply-To: <200401102231.i0AMVg7E028954@gw.catspoiler.org>
References:  <20040110152347.GD80448@madman.celabo.org> <200401102231.i0AMVg7E028954@gw.catspoiler.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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@celabo.org jvidrine@verio.net nectar@freebsd.org nectar@kth.se



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040111153520.GA89683>