sys/net/dhcpv6: Add IA_NA support to the DHCPv6 client#16228
sys/net/dhcpv6: Add IA_NA support to the DHCPv6 client#16228miri64 merged 2 commits intoRIOT-OS:masterfrom
Conversation
|
For a mesh you probably need a DHCPv6 Relay implementation first to have other nodes than the border router receive an address, right? Other than that, I can have a look at the code soon™ (currently I have to do some other stuff first, so not much time sadly) |
Oh, yes, very good point! I have to admit that so far I focused primarily on the use case of a "regular" device that requests an address via DHCPv6. But making it work for 6LoWPAN should of course be part of this PR eventually. The border router act as the relay agent in this scenario, right? Do you think the relay agent functionality should be a seperate module or could it be integrated into the existing DHCPv6 client? Edit: Hmm, or should there be a seperate PR to implement the relay agent?
No worries, thank you already :) I will continue to work on this PR – hopefully the code will be a bit more refined once you have time to look at it. |
The border router, yes, but also any router (6LR) between the border router and a leaf node when having a multihop network, as DHCPv6 is link-local only.
IMHO this should be a separate module (that should reuse client-like behavior from the client) and a separate PR for that matter, otherwise the focus of this PR can easily get out of hands ;-). |
|
@miri64 Making some small additions and updating the tests, I resumed working on this PR again now :) Maybe you could have a quick look to assess how much there is missing for this PR to be merged? |
Will do. However, I don't have much time this week. So for now, I dismiss my change request, as the comment was addressed.
|
I think I managed to make the implementation more stack-independent now. I also added the There might be still room for improvement, however. Should I maybe highlight the passages I am a bit uncertain about to make reviewing them a bit easier? |
|
@miri64 Sorry to bother you, but can you estimate when you might have the time for a review? Should I maybe highlight the probably most critical portions as suggested in my last comment? |
That would be great. Probably next week at the latest I will finally have some time to have a look! |
There was a problem hiding this comment.
Murdock had a complaint. Please squash and rebase (to resolve merge conflicts due to the merging of #16606) [edit: to my surprise there were none] immediately.
|
Please squash ;-). |
While you are at it, I think the commit message for the test needs an update ;-) |
Ehem, done ;) |
Done :) I hope the new commit message is okay |
|
Running the test for
I think it might be the easiest to just add another definition like |
|
I guess with the latest addition the tests should pass now. Let me know if there is anything that should be changed. |
With my latest proposals, the situation should be less confusing for a user. |
|
Don't forget about #16228 (comment) ;-) |
Ahem, should be fixed now :) |
|
Here. We. Go. 🎉 |
Yay! \o/ Thank you so much for help and feedback along the way :) |

Contribution description
This PR adds identity association for non-temporary addresses (IA_NA) to the DHCPv6 client and makes it possible to use the
auto_init_dhcpv6_clientmodule for auto configuring it.While requesting a non-temporary address already works (see below), the implementation is probably not finished yet as I wasn't entirely sure how to correctly add the obtained address to the respective net interface and where to remove them if their lifetime passes. There also some other aspects which I wasn't quite sure about (the relevant lines on
IA_NAin_nib-slaac.cfor example) and code passages that probably need refactoring.I would be very grateful to receive some feedback on this and hope that this PR is not too far away from a mergeable state.
Testing procedure
You can use the provided test under
tests/gnrc_dhcpv6_client_auto_initto test the correct assignment of a non-temporary IPv6 address. You can run it by first usingmake alland thensudo make test-as-root.For the test procedure, the existing test under
tests/gnrc_dhcpv6_client_6lbrwas adapted, which uses the Python libraryscapy.