*** From dhcp-server -- To unsubscribe, see the end of this message. ***
I can't imagine how one could wind up with an all-zero packet in the first
place. However, I do know that changing, for example:
ip.ip_sum = wrapsum (checksum ((unsigned char *)&ip, sizeof ip,
0));
into:
ip.ip_sum = wrapsum (checksum ((unsigned char *)&ip, sizeof ip,
0xffff));
would make it completely impossible (and does not require enormous processing
overhead or drastic code changes). That way, the checksum()/wrapsum() code
implements a 1-complement checksum for any arbitrary data block rather than a
1-complement checksum for just about any conceivable IP datagram.
As for the checksum fixing things, I think the pl26 checksum code writes a
zero to the udp checksum field before checking it, so the 0xffff checksum
would not, in fact, solve this problem. ("wrapsum()" would return 0xffff,
which would be compared to the original UDP checksum of 0xffff, so the packet
would be ok.) That brings up the question of why the UDP checksum is set to
0 before the checksum is computed rather than summing the whole thing
unmodified... (If the UDP checksum field was 0 to begin with, then there is
no point in computing checksum.) The IP checksum is verified directly (by
summing the whole block, including the checksum).
Maybe those Math professors just did too much damage before I managed to
escape...?
______________________________ Reply Separator _________________________________
Subject: Re: Re[2]: 2.0b1pl26 Checksum Issues
Author: Ted Lemon <[EMAIL PROTECTED]> at smtplink-pen
Date: 4/23/99 8:07 PM
> You might want to start the sum at negative zero instead of 0. It
> should be impossible for wrapsum() to return 0xffff unless all the
> data is zero, but one should never underestimate how clever the
> (mis)user can be. :/
Won't the checksum on the packet be 0xffff in this case, meaning that
the checksum will in fact start out at 0xffff?
_MelloN_
------------------------------------------------------------------------------
To unsubscribe from this list, please visit http://www.fugue.com/dhcp/lists
If you are without web access, or if you are having trouble with the web page,
please send mail to [EMAIL PROTECTED] Please try to use the web
page first - it will take a long time for your request to be processed by hand.
Archives for this mailing list are available at
http://www.webnology.com/list-archives/dhcp/dhcp-server
------------------------------------------------------------------------------