[pd] deprecate old prefixes in radvd configuration on DHCPv6 PD change #2701
+40
−14
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 addresses an issue where old prefixes were not being properly deprecated in the RADVD configuration when the upstream interface's delegated prefix changed. Previously, only the new prefix would be advertised, potentially leading to issues for OT still using the old prefix.
Now, upon a new PD message, dhcpcd.enter-hook will:
Identify the old and new prefixes: It retrieves the old and new prefix information from the dhcpcd environment variables.
Configure radvd to deprecate the old prefix: If an old prefix exists and is different from the new prefix, the radvd.conf file is updated to include the old prefix with a preferred and valid lifetime of 0. This signals to OT that the prefix is deprecated and should no longer be used.
Publish the new prefix: The new prefix is added to radvd.conf with the appropriate lifetimes received from the DHCPv6 server.
Reload radvd: The radvd service is reloaded to apply the changes.