1 comment:
File src/commonlib/bsd/include/commonlib/bsd/ipchksum.h:
uint16_t ipchksum(const void *data, size_t size);
uint16_t ipchksum_add(size_t offset, uint16_t first, uint16_t second);
Before it was: […]
Because the checksum is defined as a 16-bit number. I don't know why the previous author (back in 2009 or whenever this was written... it was _really_ old) chose to return it as a masked unsigned long instead, but it seems awkward to me and almost all call sites seem to implicitly convert it back to u16 anyway, so I thought it made more sense to use that in the first place. (Also, the libpayload version already returned an unsigned short so I just combined the two in a way that's closer to that one.)
To view, visit change 80251. To unsubscribe, or for help writing mail filters, visit settings.