Subject: Re: Use of sun_len in AF_UNIX socket addresses
To: None <tech-net@NetBSD.org>
From: SODA Noriyuki <soda@sra.co.jp>
List: tech-net
Date: 10/11/2006 10:01:12
>>>>> On Sun, 8 Oct 2006 12:05:05 -0400 (EDT),
      der Mouse <mouse@Rodents.Montreal.QC.CA> said:

>> Looking at PR lib/34744, I was not sure if we expect userland to set
>> sun_len correctly.  A quick grep through our tree shows about 10 out
>> of about 20 source files doing it, the others seem to leave sun_len
>> as zero.

>> The kernel cares about sun_len at very few places, and I fail to see
>> the big picture. Since apparently the userland parts that do not set
>> sun_len work just fine, I guess we could replace the few kernel
>> usages of sun_len with SUN_LEN()?

> 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.

That's practically impossible, at least for third party packages,
because only 4.4BSD derived OSes have the sun_len member, and Solaris,
HP-UX and Linux don't have the sun_len member.
(Even 4.3BSD-tahoe didn't have it, either.)
-- 
soda