ipv6_netif: add prefix list to interface#2723
Conversation
sys/include/net/ng_ipv6/netif.h
Outdated
There was a problem hiding this comment.
sure you want the prefix to be either 0 or >128? -> s/not//
|
looks sane to me, ACK if the comments above are addressed. |
cc89aa7 to
d053fd8
Compare
|
Addressed comments and rebased. |
There was a problem hiding this comment.
prefix_len < 1 is only checking the case for prefix_len being 0 (because it's defined as uint8_t and never becomes negative). You could replace this by (!prefix_len) || (prefix_len > 128).
But I would prefer the (maybe more optimized) alternative: ((unsigned) x - 1 > 127). This will result in true for x < 1 and x > 128.
There was a problem hiding this comment.
always choose readability before optimizations. The compiler will probably choose the fastest evaluation of the condition anyway.
There was a problem hiding this comment.
IMHO, there is nothing wrong in helping the compiler to achieve a good level of optimization (: Nevertheless, since we are dealing with a wide range of platforms and compilers, it might make sense to manually apply some basic optimizations (like this one for range checking)
There was a problem hiding this comment.
Done. (I don't like writing !prefix_len instead of prefix_len == 0 though)
679f066 to
7af5420
Compare
|
And rebased once again. |
627c987 to
475cbc5
Compare
475cbc5 to
d908421
Compare
|
Had a little error: multicast-addresses do not have prefixes in the sense that unicast/anycast addresses have: I set the prefix length for all multicast addresses to 128. |
|
And go |
ipv6_netif: add prefix list to interface
This adds the prefix list, needed for Neighbor Discovery to
ipv6_netifby adding aprefix_lenfield to its address list.