-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPv6: implement source address candidate selection #3561
Conversation
Currently only the candidate address selection algorithm is implemented. The rest follows later today. |
uint8_t *candidate_set) | ||
{ | ||
for (int i = 0; i < NG_IPV6_NETIF_ADDR_NUMOF; i++) { | ||
ng_ipv6_addr_t *iter = &(iface->addrs[i].addr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you might need to utilize the mutex of ng_ipv6_netif_t
, before accessing any further members of this struct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, see l514
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm, you are using the mutex in L514
433d611
to
5ff219e
Compare
|
5ff219e
to
9429c79
Compare
Just wondering: are anycast addresses excluded (or rather should they be) in this algorithm too? |
Not sure. First their are not explicitly mentioned - in fact I'm not even sure if comparison to anything else apart from link-local, site-local, and global unicast is described in the RFC, but since I have to compare the other types anyway to determine a global unicast address and it seems sensible to me, I did it this way. Second, is their a way to distinguish anycast addresses? A very brief look haven revealed anything, but maybe I gave up to quickly. |
I'm not sure if anycast addresses are allowed to be source addresses… Too lazy to find a source right now, but they are definitely not global unicast addresses, as the name implies ;-).
Not syntactically, no. RFC 4291 states they should be marked as such on the interface. In our implementation this is achieved by the |
RFC6724 says:
I know. |
9429c79
to
604e5dc
Compare
Rebased on master. Still depending on #3573. |
About the anycast addresses: Apparently they are not forbidden as source address, but also they are not explicitly mentioned as being preferred in any rule. From a logical point of view, it doesn't seem sensible to prefer an anycast address as source address if the destination address is anycast. What do you think? |
why has the destination address anything to do with that (and by the way I don't understand your logical conclusion that src should be preferred as NOT being anycast when the dst IS anycast) |
That's basically the only criteria for choosing the source address.
That's not what I wrote. I say it doesn't seem to make sense to prefer the anycast address as source. |
604e5dc
to
92c69ee
Compare
Pushed some code size optimizations. Not longer dependent on #3573. |
Reading the RFC again I figured out that rule 2 isn't implemented properly. |
Hm, all the ways I tried so far are way too big. Hang on! |
92c69ee
to
082ce7d
Compare
addressed comments |
fixed a comment, that was a leftover from a previous version |
bool src_search) | ||
/** | ||
* @brief selects potential source address candidates | ||
* see http://tools.ietf.org/html/rfc6724#section-4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use @see
tag + <a href="…">RFC 6724, section 4</a>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a C file, but sure, I can do.
Hopefully addressed everything. |
Works! Let me have a last look at the code, then I'll ACK. |
ACK, please squash. |
775e1c0
to
6ca74a7
Compare
squashed |
Anycasts are not explicitly forbidden according to RFC6724, Appendix B.
6ca74a7
to
65e2acb
Compare
Fixed missing |
IPv6: implement source address candidate selection
The comment exists since the introduction of the [original implementation], but its meaning is unclear and misleading, as the code doesn't do anything with link-local. [original implementation]: RIOT-OS#3561
The comment exists since the introduction of the [original implementation], but its meaning is unclear and misleading, as the code doesn't do anything with link-local. [original implementation]: RIOT-OS#3561
WIP, see http://tools.ietf.org/html/rfc6724#section-4