mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-06 07:00:59 +00:00
use big endian to calculate IPv4 checksum
This commit is contained in:
parent
2c2cb22566
commit
e7057cf0c6
@ -237,7 +237,7 @@ static uint16_t calc_internet_checksum(uint8_t * data, int size){
|
|||||||
uint32_t checksum = 0;
|
uint32_t checksum = 0;
|
||||||
while (size){
|
while (size){
|
||||||
// add 16-bit value
|
// add 16-bit value
|
||||||
checksum = sum_ones_complement(checksum, *(uint16_t*)data);
|
checksum = sum_ones_complement(checksum, READ_NET_16(data, 0));
|
||||||
data += 2;
|
data += 2;
|
||||||
size -= 2;
|
size -= 2;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user