1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc_ipv6: fix _fill_ipv6_hdr() for pure IPv6 packets

If a packet only contains IPv6 and IPv6 extension header snips (e.g. if
the IPv6 packet has no payload or if an extension header was not
pre-parsed)
This commit is contained in:
Martine Lenders 2018-11-17 12:15:59 +01:00
parent 3b1a7d0eee
commit 3ec37acbd1

View File

@ -442,7 +442,7 @@ static int _fill_ipv6_hdr(gnrc_netif_t *netif, gnrc_pktsnip_t *ipv6)
}
prev->next = payload;
prev = payload;
} while (_is_ipv6_hdr(payload));
} while (_is_ipv6_hdr(payload) && (payload->next != NULL));
DEBUG("ipv6: calculate checksum for upper header.\n");
if ((res = gnrc_netreg_calc_csum(payload, ipv6)) < 0) {
if (res != -ENOENT) { /* if there is no checksum we are okay */