see patch.
Stefan Reinauer wrote:
change prototype. We're stuffing a binary array in here not shorts.
Signed-off-by: Stefan Reinauer stepan@coresystems.de
Index: libpayload/include/libpayload.h
--- libpayload/include/libpayload.h (revision 3488) +++ libpayload/include/libpayload.h (working copy) @@ -154,7 +154,7 @@ int toupper(int c);
/* libc/ipchecksum.c */ -unsigned short ipchksum(const unsigned short *ptr, unsigned long nbytes); +unsigned short ipchksum(const void *ptr, unsigned long nbytes);
Maybe u8?
Anyway;
Acked-by: Peter Stuge peter@stuge.se
Actually the IP checksum as designed works on u16.
it's a simple sum across the two-byte elements of a message.
ron
ron minnich wrote:
Actually the IP checksum as designed works on u16.
it's a simple sum across the two-byte elements of a message.
ron minnich wrote:
http://www.netfor2.com/checksum.html
the reference
I guess RFC1701 (as mentioned in checksum.html) is the original reference. But never mind - what do we typically call ipchksum() on?
The case is already done internally and I think that's fine. Anyways, since it is casted, void * works for me and my ack is still good. :)
//Peter
On Fri, Aug 29, 2008 at 4:16 PM, Peter Stuge peter@stuge.se wrote:
The case is already done internally and I think that's fine. Anyways, since it is casted, void * works for me and my ack is still good. :)
there are a few key reasons it was defined for IP the way it was, which make interesting reading, but the Big Picture is that the area checksummed should be an even number of bytes long.
ron