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/nib: consolidate prefix removal code in _nib_offl_remove_prefix() #16729
Conversation
21a195f
to
b18b59c
Compare
Did you test this with your setup? |
Yes I ran the test steps from #16750 |
e48cd02
to
c599dd8
Compare
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.
Please squash. I trust your testing.
c599dd8
to
10887eb
Compare
All green here 😉 |
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.
Then lets gooooo 🚀
@miri64 as @chrysn mentioned prefix deprecation, how would this be done in this context? |
A prefix is not deprecated, the associated addresses are (see also RFC 4862, section 5.5.4). This happens here RIOT/sys/net/gnrc/network_layer/ipv6/nib/nib.c Lines 1334 to 1355 in abeb9c8
The timer for that is armed here RIOT/sys/net/gnrc/network_layer/ipv6/nib/_nib-internal.c Lines 830 to 841 in abeb9c8
Sure, we could also add a respective flag and deprecation timer for prefixes to implement RFC 4861, section 6.2.7 to the letter. However, deprecation is in the end only relevant for addresses, so why have another mechanism for prefixes (see the Terminology section of RFC 4862 (section 2))?
|
Contribution description
There are three places in which a prefix gets removed:
_handle_pfx_timeout()
_remove_prefix()
nib prefix del
shell command resulting ingnrc_ipv6_nib_pl_del()
However, they all do slightly different things. The code in
_handle_pfx_timeout()
appears to be the most complete, so move it to a common function that can be used by the other cases as well.The
_handle_snd_mc_ra()
function ingnrc_ipv6_nib_pl_del()
did not do much in informing downstream nodes that the prefix was removed - it would only schedule sending a RA without the prefix, but omission does not mean deprecation.I replaced it with a new
_snd_rtr_advs_drop_pfx()
function that sends a RA that includes a PIO with a lifetime of 0 to indicate that the prefix must be removed.I'm not entirely happy about this as I would rather have the removed prefix (with ltime = 0) included in normal RAs for a grace period (in case this RA gets lost) but that would require some more elaborate changes.
Testing procedure
Issues/PRs references