Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the following issue I observed when using
sunshine
as RPL root on a RPi with OpenLabs transceiver and 2 sensor nodes running RIOT gnrc_networking example.RPL root (
sunshine
) has rank 1, the first RIOT nodes takes up rank 257, after sending a DAOsunshine
adds a route to that first child node. Starting the second RIOT node it first chooses the other RIOT node as parent, hence has rank 513. Whensunshine
hears the DAO of the second node it correctly implements a route via the first RIOT node as first hop.However, when
sunshine
sends its next DIO both RIOT nodes receive that and the second RIOT node changes its parent to the RPL root node runningsunshine
, hence adapting its rank to 257 as the first RIOT node. Aftersunshine
hears the DAO it should change the route for the second node, that is changing the next hop. Without this fix, this does not happen,sunshine
would still assume to reach the second node via the first one - any packet from RPL root to the second child would end up in a loop, bouncing back-and-forth between root and the first (child) node.My fix changes the command from
ip -6 route add ...
toip -6 route replace ...
which changes the next hop if route already present or adds a new route if none exists.The code changes are minor and not beautiful, I didn't take the time to apply coding conventions. As I read in the code, the respective commands are bound to change to use netlink. However, this fix is required otherwise
sunshine
does not adapt to route changes of its children.