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

Merge pull request #9672 from miri64/gnrc_ipv6/fix/8215-regression

gnrc_ipv6: fix regression from #8215
This commit is contained in:
Gaëtan Harter 2018-08-02 15:40:51 +02:00 committed by GitHub
commit d5505930cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -426,14 +426,12 @@ static int _fill_ipv6_hdr(gnrc_netif_t *netif, gnrc_pktsnip_t *ipv6)
payload = ipv6;
prev = ipv6;
do {
gnrc_pktsnip_t *tmp;
/* IPv6 header itself was already write-protected in caller function,
* just write protect extension headers and payload header */
payload = payload->next;
tmp = gnrc_pktbuf_start_write(payload);
if (tmp == NULL) {
if ((payload = gnrc_pktbuf_start_write(payload->next)) == NULL) {
DEBUG("ipv6: unable to get write access to IPv6 extension or payload header\n");
gnrc_pktbuf_release(ipv6);
/* packet duplicated to this point will be released by caller,
* original packet by other subscriber */
return -ENOMEM;
}
prev->next = payload;
@ -443,6 +441,7 @@ static int _fill_ipv6_hdr(gnrc_netif_t *netif, gnrc_pktsnip_t *ipv6)
if ((res = gnrc_netreg_calc_csum(payload, ipv6)) < 0) {
if (res != -ENOENT) { /* if there is no checksum we are okay */
DEBUG("ipv6: checksum calculation failed.\n");
/* packet will be released by caller */
return res;
}
}