Skip to content

Commit

Permalink
gnrc_ipv6_ext_frag: remove fragment header when n-th fragment is first
Browse files Browse the repository at this point in the history
The reassembly buffer only needs (and stores) the headers *before* the
fragment header (called per-fragment headers in RFC 8200, section 4.5).
Currently, when a subsequent IPv6 fragment is received before the first
fragment the fragment header is however not removed. With this fix it
does.
  • Loading branch information
miri64 committed Jan 17, 2020
1 parent cf5356d commit 28ef3b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sys/net/gnrc/network_layer/ipv6/ext/frag/gnrc_ipv6_ext_frag.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,10 @@ gnrc_pktsnip_t *gnrc_ipv6_ext_frag_reass(gnrc_pktsnip_t *pkt)
memcpy(((uint8_t *)rbuf->pkt->data) + offset, pkt->data, pkt->size);
/* if entry was newly created above */
if (rbuf->pkt->next == fh_snip->next) {
/* we don't need the payload anymore, headers are still kept to be
* reused when assembled, so just remove the payload. */
/* we don't need the payload and fragment header anymore, the
* remaining headers are still kept to be reused when assembled, so
* just remove the payload. */
gnrc_pktbuf_remove_snip(pkt, fh_snip);
gnrc_pktbuf_remove_snip(pkt, pkt);
}
else {
Expand Down

0 comments on commit 28ef3b6

Please sign in to comment.