]>
git.ipfire.org Git - thirdparty/dhcpcd.git/commit
DHCP: Fix checksum validation
in_cksum falls over with struct ip in a union of uint16_t with
some compilers.
The fix is to create a smaller pseudo header, fill in the bits
we need and then copy this to a uint8_t array which we then
send to in_cksum.
Tested on Debian-12 with clang-15 and CFLAGS=-Os
While here, just check that the UDP checksum check is zero
rather than zeroing it out and checking it matches.
Co-authored-by: Zikai Chen <chenzikai@google.com>