mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
Fix UDP checksum calculation (fixes #360)
Missing parantheses around the calculation of last byte address in a UDP Packet led to dereferencing the wrong value, thereby the UDP checksum calculation failed, whenever an odd byte-count UPD packet was calculated. Many thanks to Markus Partheymueller who discovered this issue and its resolution.
This commit is contained in:
parent
97c3f6599d
commit
5c36639031
@ -136,7 +136,7 @@ namespace Net {
|
||||
/* if udp length is odd, append a zero byte */
|
||||
if (length() & 1) {
|
||||
Genode::uint8_t last[] =
|
||||
{ *(Genode::uint8_t*)this + (length()-1), 0 };
|
||||
{ *((Genode::uint8_t*)this + (length()-1)), 0 };
|
||||
sum += bswap(*(Genode::uint16_t*)&last);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user