[BusyBox] udhcp patches/ endianess

Rainer Weikusat rainer.weikusat at sncag.com
Wed Feb 2 18:32:02 UTC 2005


Russ Dill <Russ.Dill at asu.edu> writes:
>> So unless I am very much mistaken, this is correct for both
>> cases.
>
> Why not keep the known, working crc algorithm?

<nitpicking>
This isn't a CRC algorithm.
</>

> Its not as if the code is doing the calculation very often and on
> very much data.

If you have cycles to waste, what keeps you from using the 'known to be
working' code, which is known to be working, because it's copied out
of UNIX Network Programming, with RWS having copied it out of a
'public domain' ping program? Nothing. Maybe one day gcc will come
down on you badly because of the undefined and implementation
defined constructs used in the code, but this, too, is entirely your
problem. It certainly won't be mine, because I don't feel inclined to
add more compiler versions to the zoo I am already maintaining on my
machine to accomodate various other 'known to be working' pieces of
legacy code.

And there is the additional issue that someone might be tempted to use
the code to calculate IP checksum for other types of datagrams, which
will work nicely as long as the sum does not exceed the value 2^31,
thereby affecting the sign bit of the int32_t and turning the 'fold'
loop into an endless loop, which is an effect that I would rather
prevent than fix (and people will mindlessly copy to code out of
there). 

>> As you have pointed out in a previous e-mail: I have the source and
>> can twist that to my liking (for instance, I like working timeout
>> algorithms and I dislike sending out packets containing 302
>> meaningless zero octets.
>
> Some clients and server barf on packets that don't have the full payload
> size.

There is no such thing as the 'full DHCP payload size' anymore (since
1997). ISC uses 300 as minimum payload size, probably for
interoperability with BOOTP relay agents. I would agree that it makes
sense to provides this kind of behaviour on request to work around an
actual problem, I (and that's only me) just don't like it as a default
which cannot be easily changed.






More information about the busybox mailing list