[riot-notifications] [RIOT-OS/RIOT] gnrc_icmpv6_echo: use gnrc_netif_hdr_set_netif() (#11916)

Marian Buschsieweke notifications at github.com
Fri Jul 26 16:19:43 CEST 2019


maribu commented on this pull request.



>              data->hostname = arg;
 #ifdef MODULE_SOCK_DNS
             if (sock_dns_query(data->hostname, &data->host, AF_INET6) == 0) {
                 continue;
             }
 #endif
-            data->iface = ipv6_addr_split_iface(data->hostname);
-            if (data->iface < KERNEL_PID_UNDEF) {
+            iface = ipv6_addr_split_iface(data->hostname);
+            if (iface > KERNEL_PID_UNDEF) {

The doc of [`ipv6_addr_split_iface()`](http://api.riot-os.org/group__net__ipv6__addr.html#ga781811ddaaa0f3a327cfaa306ea26769) indicates that `-1` would be the return value that indicates an error, not `KERNEL_PID_UNDEF` (which is defined to be `0`). I'd assume that `ipv6_addr_split_iface()` will never return 0, so this would behave identical with checking for `-1`. But I'd prefer if the code would check for the error code given in the API documentation.

-- 
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/11916#pullrequestreview-267215750
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190726/cd42eaaa/attachment.htm>


More information about the notifications mailing list