[riot-notifications] [RIOT] gnrc_sixlowpan_nd: initial import of host behavior of 6LoWPAN-ND (#3748)

Martine Lenders notifications at github.com
Tue Sep 8 17:38:05 CEST 2015


> +        *l2addr_len = sizeof(eui64_t);
> +        memcpy(l2addr, &next_hop->u8[8], sizeof(eui64_t));
> +        _revert_iid(l2addr);
> +#if (GNRC_NETIF_NUMOF == 1)
> +        (void)ifnum;
> +        return ifs[0];
> +#else
> +        for (unsigned i = 0; i < ifnum; i++) {
> +            iface = gnrc_ipv6_netif_get(ifs[i]);
> +            if ((iface != NULL) && (iface->flags & GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN)) {
> +                /* always take the first 6LoWPAN interface we can find */
> +                return ifs[i];
> +            }
> +        }
> +        return KERNEL_PID_UNDEF;    /* no 6LoWPAN interface? Something went wrong. */
> +#endif

>From https://github.com/RIOT-OS/RIOT/pull/3748#discussion_r38927704 (in outdated diff)
> Then it's just a superfluous ifdef.

Just return the only interface that there is vs. for-loop + getting of the IPv6 interface + checking if that interface is a 6LoWPAN interface. How is that superfluous, when it prevents a lot of "useless" checking?

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/3748/files#r38941027
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150908/132debb5/attachment.html>


More information about the notifications mailing list