<p><b>@benpicco</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/11596#discussion_r324418500">sys/net/gnrc/network_layer/ipv6/ext/frag/gnrc_ipv6_ext_frag.c</a>:</p>
<pre style='color:#555'>> +        /* 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);
</pre>
<blockquote>
<p>Either another fragment was already received (<code>rbuf->pkt != NULL</code>), then <code>rbuf->pkt</code> was already resized to the appropriate length until the previously received packet at the link you gave and we land here.</p>
</blockquote>
<p>Is there a check that the fragment sizes are sound before? What happens if I first send fragment 2 claiming the total packet length is 42, then send fragment 1 with <code>pkt->size = 94</code>?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11596?email_source=notifications&email_token=ABE7WYETS5EDQ4OW6EAZGCLQJSTSJA5CNFSM4HQECP7KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCEXVHPI#discussion_r324418500">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYBUQJRNSVUXM2CRU4DQJSTSJANCNFSM4HQECP7A">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYHZI6TNZBCS3XT7JOTQJSTSJA5CNFSM4HQECP7KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCEXVHPI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11596?email_source=notifications\u0026email_token=ABE7WYETS5EDQ4OW6EAZGCLQJSTSJA5CNFSM4HQECP7KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCEXVHPI#discussion_r324418500",
"url": "https://github.com/RIOT-OS/RIOT/pull/11596?email_source=notifications\u0026email_token=ABE7WYETS5EDQ4OW6EAZGCLQJSTSJA5CNFSM4HQECP7KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCEXVHPI#discussion_r324418500",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>