-
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
gnrc_uhcpc: initialize rpl root on prefix configuration #8173
Conversation
Nice! |
if (inst) { | ||
gnrc_rpl_instance_remove(inst); | ||
} | ||
gnrc_rpl_root_init(gnrc_wireless_interface, (ipv6_addr_t*)prefix, false, false); |
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.
Hm, I don't like the idea of using gnrc_wireless_interface
as the instance id. Instance IDs can be global or local, depening on the range (global for 0 <= x <= 127). In the unlikely event, that gnrc_wireless_interface
is a very high number, this would lead to semantic side effects of initializing a local instance instead of a global one. I guess a global instance makes the most sense here.
I'd propose:
gnrc_rpl_root_init(0, (ipv6_addr_t*)prefix, true, false);
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.
Whoops, I misinterpreted some arguments there. @cgundogan How about reusing GNRC_RPL_DEFAULT_INSTANCE
here and on line 96?
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.
Yeah, using GNRC_RPL_DEFAULT_INSTANCE
is probably also nice (: 👍
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.
Fixed
@bergzand could you also add |
I'd prefer to do that in a separate PR if you don't mind. As it influences the build size of the example, it could make this PR unnecessary complicated if somebody disagrees or it pushes the build size beyond the capabilities of one of the boards. |
@bergzand you missed that |
@cgundogan Ah 😑 Added the suggestion and a short explanation to the makefile. |
@bergzand that's magnificent! Please squash. |
6efd2f7
to
0d2763d
Compare
squashed |
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.
ACK
This PR adds functionality to gnrc_uhcpc to initialize a border router as RPL dodag root when the RPL module is included. When a new prefix is retrieved over uhcpc the old instance is deleted and a new dodag root with the new prefix is created.
Testing:
GNRC_NETIF_IPV6_ADDRS_NUMOF
was set to 3 as a work around for #8172.