tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: patch: sockaddr instead of mbuf to carry addresses



> The mess was already made when we started permitting non-sockaddr_foo
> structures to be shoved into an interface taking sockaddr *.

Well, if you're concerned about AF_LOCAL addresses not always fitting
inside a struct sockaddr_storage, I would say the mess comes from a
combination of (a) having an address family whose addresses are
potentially very large (I think even 255, never mind PATH_MAX +
sockaddr overhead, counts as `very large', for sockaddrs) and (b)
having its AF-specific sockaddr (struct sockaddr_un) variant smaller
than the maximum size that AF actually supports (UCHAR_MAX, ought to be
PATH_MAX + sockaddr overhead).

I do, however, note that the unix(4) manpage on at least one NetBSD
version (5.2, the handiest at the moment) says that "UNIX-domain
addresses are variable-length filesystem pathnames of at most 104
characters.", which means it's arguable that allowing AF_LOCAL paths
over 104 octets is a bug - and a 104-octet sockaddr_un does fit inside
a struct sockaddr_storage.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index