From 1a73348933100aa32d6095eaeef4f34af53ee52f Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Sat, 7 Nov 2015 08:54:24 +0100 Subject: [PATCH] use big endian to calculate IPv4 checksum --- test/pts/bnep_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pts/bnep_test.c b/test/pts/bnep_test.c index 23176772a..5de90e2d1 100644 --- a/test/pts/bnep_test.c +++ b/test/pts/bnep_test.c @@ -237,7 +237,7 @@ static uint16_t calc_internet_checksum(uint8_t * data, int size){ uint32_t checksum = 0; while (size){ // add 16-bit value - checksum = sum_ones_complement(checksum, *(uint16_t*)data); + checksum = sum_ones_complement(checksum, READ_NET_16(data, 0)); data += 2; size -= 2; }