1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

use correct length for UDP checksum calculation

This commit is contained in:
Oleg Hahm 2013-11-20 02:20:24 +01:00
parent 6804164a35
commit 05eb5a8ba6

View File

@ -35,7 +35,7 @@
uint16_t udp_csum(ipv6_hdr_t *ipv6_header, udp_hdr_t *udp_header)
{
uint16_t sum;
uint16_t len = udp_header->length;
uint16_t len = NTOHS(udp_header->length);
sum = len + IPPROTO_UDP;
sum = csum(sum, (uint8_t *)&ipv6_header->srcaddr, 2 * sizeof(ipv6_addr_t));