[riot-notifications] [RIOT-OS/RIOT] gnrc_icmpv6_error / gnrc_ipv6: fixes for unspecified address (#10421)

Koen Zandberg notifications at github.com
Sat Nov 17 15:03:48 CET 2018


bergzand commented on this pull request.



> @@ -237,39 +237,69 @@ static void _send(gnrc_pktsnip_t *pkt, const gnrc_pktsnip_t *orig_pkt)
     }
 }
 
+static gnrc_pktsnip_t *_check_ipv6_hdr(const gnrc_pktsnip_t *orig_pkt)
+{
+    /* discarding const qualifier is safe here */
+    gnrc_pktsnip_t *ipv6 = gnrc_pktsnip_search_type((gnrc_pktsnip_t *)orig_pkt,
+                                                    GNRC_NETTYPE_IPV6);
+    const ipv6_hdr_t *ipv6_hdr = ipv6->data;
+    assert(ipv6 != NULL);
+
+    if (ipv6_addr_is_unspecified(&ipv6_hdr->src)) {
+        ipv6 = NULL;
+    }
+    return NULL;

Shouldn't this be `ipv6` instead of `NULL`?

-- 
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/10421#pullrequestreview-176054913
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20181117/57bf28ec/attachment.html>


More information about the notifications mailing list