tech-net archive

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

Re: sin_zero



> Let me translate your email...

> You want the kernel to support sin_zero being non-zero so that you
> don't have to initialise a field that should be zero to zero.

Well, I would say, rather, so that unnecessary bits are ignored, or not
present at all, rather than being accepted and used in undocumented,
arcane, and difficult-to-detect ways.  (The stock userland tools like
netstat don't print those bits even if they're nonzero, or at least I
haven't found one that does.)

It doesn't help that inet(4), the one manpage I have managed to find
that describes sockaddr_in at all, doesn't describe the semantics of
_any_ of the fields.  (That page is known to lag reality, though; the
1.4T version does not mention sin_len, and says sin_family is short,
even though the first two bytes had been split for quite some time by
that point.)

> Would you also like to rename sin_zero to sin_garbage?

If I have to keep it, yes, or perhaps sin_padding.  But I'd rather
remove it entirely; the only excuse for it I can see is to make
sockaddr_in no smaller than sockaddr, and I don't see what the value in
that is. ohmori said that not all OSes have it, so it's something
portable code (FSVO "portable") cannot assume the existence of.

/~\ 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