IPv6: implement source address candidate selection#3561
IPv6: implement source address candidate selection#3561OlegHahm merged 3 commits intoRIOT-OS:masterfrom
Conversation
|
Currently only the candidate address selection algorithm is implemented. The rest follows later today. |
There was a problem hiding this comment.
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.
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 |
There was a problem hiding this comment.
use @see tag + <a href="…">RFC 6724, section 4</a>
There was a problem hiding this comment.
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. |
see http://tools.ietf.org/html/rfc6724#section-4 and http://tools.ietf.org/html/rfc6724#section-5
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