Subject: Re: Use of sun_len in AF_UNIX socket addresses
To: None <tech-net@NetBSD.org>
From: Antti Kantee <pooka@cs.hut.fi>
List: tech-net
Date: 10/11/2006 22:41:56
On Wed Oct 11 2006 at 20:01:37 +0200, Christian Biere wrote:
>
> > Since sun_len is the sockaddr_un pun of sockaddr.sa_len, I would very much
> > prefer to make sure everything sets sun_len correctly, and make the kernel use
> > it properly.
>
> With respect to userland I for one would prefer if sun_len disappeared. Many
> other systems e.g., IRIX, Solaris don't have it and a lot software (maybe most)
> ignores it. As NetBSD seems to ignore it and doesn't even document it, getting
> rid of it seems an obvious choice to me. I don't mind what the kernel does. I
> don't have a strong opinion on that though, if sun_len is there but ignored,
> that's fine by me too.
You can't get rid of it since the kernel uses the same memory layout for
the structure. Of course you could play games, but that's not really
a thing I want to see just to hide the field. You can't set it wrong,
so does it really matter?
--
Antti Kantee <pooka@iki.fi> Of course he runs NetBSD
http://www.iki.fi/pooka/ http://www.NetBSD.org/
"la qualité la plus indispensable du cuisinier est l'exactitude"