-
Notifications
You must be signed in to change notification settings - Fork 2.1k
gnrc/rpl/control_messages: refactor gnrc_rpl_recv_DIO
#21577
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
base: master
Are you sure you want to change the base?
Conversation
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.
Thank you for taking up the task of breathing some new life into RPL! A working mesh protocol in RIOT would be highly appreciated.
Friendly ping :) I have a few other changes in RPL that I'd like to PR but they depend on this branch. |
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.
Looks good to me - sorry for the delay.
I suppose you ran e.g. tests/net/gnrc_rpl
(unfortunately we disabled that on CI 😕)
Last commits just add docs, and fix one copy-paste error I noticed while self reviewing. One more thing I noticed just now is that there is actually a minor logic change in this PR: We now don't remove the whole RPL instance anymore if our preferred parent sent a DIO message with invalid options. Instead we just early return after the parent was updated (which doesn't change any dodag opts).
Yes, I ran all RPL tests, and did some manual testing described in the PR description. Edit: Should I squash now? (will fix the typos while squashing) |
7ca70d5
to
51f2647
Compare
51f2647
to
0508446
Compare
0508446
to
a461e5c
Compare
Extract commit logic from `_recv_DIO_for_{existing,new}_dodag` into new function `_update_dodag_from_DIO`. The function updates the dodag and parent based on the DIO data.
Contribution description
The
gnrc_rpl_recv_DIO
function ingnrc_rpl_control_messages
is > 150 LOC that are quite hard to understand, especially as someone that is new to RIOT.This PR refactors the function into smaller sub-functions and extracts logic that is common between the two main branches (creating a new DODAG and updating an existing DODAG).
I split the refactoring into separate commits that are easier to review one-by-one; can squash them together at the end.
I am not super happy with the resulting code, but I think it is a small improvement.
Further feedback on how to improve it would be appreciated.
Open TODOs
Testing procedure
This PR shouldn't change any logic apart from the order in which individual DODAG properties are updated (see a8bc3ad).
I tested it manually:
examples/networking/gnrc_networking
+ addedUSEMODULE += nimble_rpble
A
set as root (ifconfig 8 add 2001:db8:1::1/64
&&rpl root 1 2001:db8:1::1
)A
as rootIssues/PRs references
Preparation for future work on #21574.