tech-net archive

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

Re: refactoring ip_output() and the L2 _output()

Mouse <mouse%Rodents-Montreal.ORG@localhost> writes:

>> Agreed, 90%.  The kernel should probably zero sin_zero when needed,
>> unless the syscall interface, which means posix, perhaps, documents
>> that they must be zero.
> Even then, I think it should.  POSIX is more about political
> compromises, in many cases, than it is about good interface
> engineering.  Having eight bytes of magic data which is barely
> mentioned in the manpage (inet(4) lists it in the struct elements but
> doesn't mention it elsewhere, at least as of 5.1) but which must be
> zero for proper operation - but, if it's not zero, leads to mysterious,
> obscure, and silent failure modes?  Depending on accumulated cultural
> lore for people to learn that it's MBZ?  That is _horrible_ interface
> engineering.  I've been working with that struct for over twenty years
> and still didn't really understand what the deal was with sin_zero
> until I put a couple of days into trying to get rid of it and tracking
> down the resulting weird failures.

Sure, I have no issue with the kernel checking/zeroing (maybe logging if
DIAGNOSTIC, or some such) if there is an interface failure, if it turns
out that the spec says they are zero.  I just meant we should get spec
clarity and know what we are doing relative to it.  I agree this is
unnecessarily tricky.

Attachment: pgpjtSjJq3P1M.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index