[riot-notifications] [RIOT] Refactor 6LoWPAN module (#133)

Oleg Hahm notifications at github.com
Wed Aug 14 15:15:01 CEST 2013


> +    ipv6_addr->uint16[5] = 0;
> +    ipv6_addr->uint16[6] = 0;
> +    ipv6_addr->uint16[7] = HTONS(0x0001);
> +}
> +
> +void ipv6_iface_get_best_src_addr(ipv6_addr_t *src, const ipv6_addr_t *dest)
> +{
> +    /* try to find best match if dest is not mcast or link local */
> +    int8_t itmp = -1;
> +    uint8_t tmp = 0;
> +    uint8_t bmatch = 0;
> +
> +    if (!(ipv6_addr_is_link_local(dest)) && !(ipv6_addr_is_multicast(dest))) {
> +        for (int i = 0; i < IFACE_ADDR_LIST_LEN; i++) {
> +            if (iface.addr_list[i].state == NDP_ADDR_STATE_PREFERRED) {
> +                if (!(ipv6_addr_is_link_local(&(iface.addr_list[i].addr)))) {

Shouldn't iface.addr_list[i].addr be also checked to be neither multicast nor unique local according to RFC4193?

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


More information about the notifications mailing list