Browse Source

Update layer 4 files to fix checksum with inet_csum_slice().

cc430
Ken Bannister 7 years ago
parent
commit
1abffc84e1
  1. 2
      sys/net/gnrc/network_layer/icmpv6/gnrc_icmpv6.c
  2. 2
      sys/net/gnrc/transport_layer/udp/gnrc_udp.c

2
sys/net/gnrc/network_layer/icmpv6/gnrc_icmpv6.c

@ -42,7 +42,7 @@ static inline uint16_t _calc_csum(gnrc_pktsnip_t *hdr,
uint16_t len = (uint16_t)hdr->size;
while (payload && (payload != hdr)) {
csum = inet_csum(csum, payload->data, payload->size);
csum = inet_csum_slice(csum, payload->data, payload->size, len);
len += (uint16_t)payload->size;
payload = payload->next;
}

2
sys/net/gnrc/transport_layer/udp/gnrc_udp.c

@ -69,7 +69,7 @@ static uint16_t _calc_csum(gnrc_pktsnip_t *hdr, gnrc_pktsnip_t *pseudo_hdr,
/* process the payload */
while (payload && payload != hdr) {
csum = inet_csum(csum, (uint8_t *)(payload->data), payload->size);
csum = inet_csum_slice(csum, (uint8_t *)(payload->data), payload->size, len);
len += (uint16_t)payload->size;
payload = payload->next;
}

Loading…
Cancel
Save