[riot-notifications] [RIOT-OS/RIOT] shell_commands: fix ping6 response check for multicast (#12197)

benpicco notifications at github.com
Tue Sep 10 20:46:02 CEST 2019


benpicco commented on this pull request.



> @@ -339,7 +339,8 @@ static void _print_reply(_ping_data_t *data, gnrc_pktsnip_t *icmpv6,
 
         /* not our ping */
         if ((byteorder_ntohs(icmpv6_hdr->id) != data->id) ||
-            !ipv6_addr_equal(from, &data->host)) {
+            !(ipv6_addr_is_multicast(&data->host) &&

Or to avoid these kind of errors once and for all:

```C
        /* not our ping */
        if (byteorder_ntohs(icmpv6_hdr->id) != data->id) {
            return;
        }

        if (!ipv6_addr_is_multicast(&data->host) &&
            !ipv6_addr_equal(from, &data->host)) {
            return;
        }
```

-- 
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/12197#discussion_r322904403
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190910/88a01fd3/attachment.htm>


More information about the notifications mailing list