gnrc_ndp_host: Initial import of host behavior of router discovery#3746
gnrc_ndp_host: Initial import of host behavior of router discovery#3746OlegHahm merged 2 commits intoRIOT-OS:masterfrom
Conversation
128fbe4 to
67c7ca4
Compare
67c7ca4 to
e9d77f9
Compare
|
Rebased to current dependencies |
sys/include/net/gnrc/ipv6/netif.h
Outdated
There was a problem hiding this comment.
What's the purpose of this ifdef?
There was a problem hiding this comment.
This was introduced in #3745 and proposed by @cgundogan (#3745 (comment)). I liked the idea because it prevents that the function is called 'accidentally' ;-)
There was a problem hiding this comment.
But to answer your question in a direct manner: To generate NOP macros in the else case. (You will see this technique quite a bit throughout the NDP-expansions)
e9d77f9 to
d89da6d
Compare
d1c8aa2 to
8878f4d
Compare
|
Rebased to current master and dependencies. |
There was a problem hiding this comment.
The 10 comes from the fact, that GNRC_NDP_MIN_RAND and GNRC_NDP_MAX_RAND are bigger by a factor of 10 than in the RFC (because they are fractions). Don't know how to express that, other than already documented here: https://github.com/RIOT-OS/RIOT/blob/master/sys/include/net/gnrc/ipv6/netif.h#L296
There was a problem hiding this comment.
Actually, I understand neither this explanation nor the relation to the documentation of reach_time_base`.
There was a problem hiding this comment.
reach_time is calculated by taking gnrc_ipv6_netif_t::reach_time_base (set by the advertisement) and multiply it by a random value between 0.5 and 1.5 (https://tools.ietf.org/html/rfc4861#section-10). To avoid floating point numbers (and also have some variation) I used 5 and 15 as values for GNRC_NDP_MIN_RAND and GNRC_NDP_MAX_RAND. To get back to the original value I devided by ten (as I did on interface initialization)
There was a problem hiding this comment.
Ok, so, how about a comment here saying something like "to avoid floating point number computations, the boundaries for the random values are multiplied by 10"?
There was a problem hiding this comment.
There was a problem hiding this comment.
"in order to avoid division, we divide." :)
I did not say to avoid division, I said to avoid going to floating point computations ;-) I basically introduce a low-profile fixed-point number calculation here, if you want to call it that ;-P
There was a problem hiding this comment.
Just add a comment here and all is fine.
|
Addressed comments in previous commits. |
|
Please rebase |
14df47e to
1a84e42
Compare
|
Rebased to current master |
1a84e42 to
f76d89d
Compare
There was a problem hiding this comment.
Styling question, but for readability I prefer a newline between variable initializations and actual start of the functionality.
There was a problem hiding this comment.
I agree. Don't know, why I did it that way.
There was a problem hiding this comment.
nitpicking, but I think you overdid with parens here. ;)
There was a problem hiding this comment.
I would prefer addr or something more speaking.
|
apart from the minor comments: code is okay, test didn't break anything. ACK after addressing and squashing if Travis agrees, too. |
3fcf32f to
c367477
Compare
|
Addressed and squashed immediately. One minor thing I changed: I put the calculation and setting of reachable time related |
gnrc_ndp_host: Initial import of host behavior of router discovery
|
Thanks for the review! :-) |
This imports host behavior for NDP router discovery. This encompasses:
Depends on:
gnrc_ndp: add support for address-less link-layers #3628: address-less link-layer handling for NDPgnrc_ipv6_netif: prepare for router discovery #3745:(merged)gnrc_ipv6_netifadaptations for router discovery