Subject: Re: Use of sun_len in AF_UNIX socket addresses
To: None <tech-net@NetBSD.org>
From: Christian Biere <christianbiere@gmx.de>
List: tech-net
Date: 10/11/2006 23:24:12
Antti Kantee wrote:
> Yes, but they aren't *inside* a structure, but rather choose not to
> pollute the userspace with nameload for stuff that it can't use anyway.

> I could find only one _KERNEL in a struct with a quick glance (sys/buf.h),
> and amusing as it is, looks like a very nice place for an unexpected
> bug some day.

Well, you don't need _KERNEL. Just renaming it e.g. __sun_len and fixing
the very few references in the kernel and you're done. I've really seen
uglier stuff than that on other systems but on NetBSD as well. For example
there are many macros s_len (on Solaris IIRC), sa_len on IRIX, or s6_addr
on NetBSD that pollute the namespace and can cause really arcane bugs. That's
far from what I proposed.

But again, the main issue was the documentation. If those who care at all
about this stuff prefer to keep sun_len and SUN_LEN(), so be it.

-- 
Christian