[riot-notifications] [RIOT-OS/RIOT] gnrc_ipv6: allow sending empty IPv6 packets (#11166)

Cenk Gündoğan notifications at github.com
Wed Mar 27 18:42:49 CET 2019


cgundogan requested changes on this pull request.



> -        if ((payload = gnrc_pktbuf_start_write(payload->next)) == NULL) {
-            DEBUG("ipv6: unable to get write access to IPv6 extension or payload header\n");
-            /* packet duplicated to this point will be released by caller,
-             * original packet by other subscriber */
-            return -ENOMEM;
-        }
-        prev->next = payload;
-        prev = 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 */
-            DEBUG("ipv6: checksum calculation failed.\n");
-            /* packet will be released by caller */
-            return res;
+    if (ipv6->next != NULL) {

you can save this new check by turning the `do .. while()` into a `while()` (:

-- 
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/11166#pullrequestreview-219624652
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190327/fc0b237f/attachment.html>


More information about the notifications mailing list