[riot-notifications] [RIOT-OS/RIOT] gnrc_ipv6_ext_frag: Initial import of IPv6 reassembly (#11596)

Martine Lenders notifications at github.com
Sat Sep 14 10:16:56 CEST 2019


miri64 commented on this pull request.



> +        /* first fragment */
+        uint16_t ipv6_len = byteorder_ntohs(ipv6->len);
+
+        /* not divisible by 8*/
+        if ((pkt->size & 0x7)) {
+            DEBUG("ipv6_ext_frag: fragment length not divisible by 8");
+            goto error_exit;
+        }
+        _set_nh(fh_snip->next, nh);
+        gnrc_pktbuf_remove_snip(pkt, fh_snip);
+        /* TODO: RFC 8200 says "- 8"; determine if `sizeof(ipv6_ext_frag_t)` is
+         * really needed*/
+        rbuf->pkt_len += ipv6_len - pkt->size - sizeof(ipv6_ext_frag_t);
+        if (rbuf->pkt != NULL) {
+            /* first fragment but not first arriving */
+            memcpy(rbuf->pkt->data, pkt->data, pkt->size);

(and that it fits before the already stored fragments is ensured [here](https://github.com/RIOT-OS/RIOT/pull/11596/files#diff-70b063778a3f60ee4d99760ea342b819R135-R147)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11596#discussion_r324416971
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190914/72fec778/attachment.htm>


More information about the notifications mailing list