ot-br-posix
ot-br-posix copied to clipboard
[pd] support of multiple prefixes publishing and deprecating
Add support of multiple prefixes handling in both
-
dhcpcd.enter-hook (Publishing Prefixes):
- This script is triggered when dhcpcd gets new or updated IPv6 PD information.
- It now iterates through multiple new_dhcp6_ia_pd*_prefix* environment variables (where * is a number), allowing for multiple prefixes.
- For each prefix, it extracts the prefix, length, valid lifetime (vltime), and preferred lifetime (pltime). If lifetime is zero, it means the prefix is deprecated.
- It then constructs a radvd.conf file that includes multiple prefix blocks, each with its own lifetimes.
- It reloads or restarts radvd to apply the new configuration.
-
dhcpcd.exit-hook (Deprecating Prefixes):
- This script is triggered when dhcpcd releases or expires IPv6 PD information.
- It now iterates through multiple old_dhcp6_ia_pd*_prefix* environment variables to find prefixes that are no longer valid.
- For each deprecated prefix, it sets the AdvPreferredLifetime and AdvValidLifetime to 0 in radvd.conf.
- It reloads or restarts radvd to apply the updated configuration.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 44.37%. Comparing base (
2b41187) to head (1114765). Report is 982 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #2743 +/- ##
===========================================
- Coverage 55.77% 44.37% -11.40%
===========================================
Files 87 113 +26
Lines 6890 13588 +6698
Branches 0 965 +965
===========================================
+ Hits 3843 6030 +2187
- Misses 3047 7242 +4195
- Partials 0 316 +316
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚀 New features to boost your workflow:
- ❄ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@yangsong-cnyn @bukepo I'm trying to understand what the purpose is of this PR and of the function that it is modifying.
If a prefix gets delegated to a BR, that alone won't have any impact on the RAs being sent on the AIL. So no reason to change anything in the RAs based on DHCPv6-PD events alone.
The only requirement is that the RA must advertise all on-mesh+routable prefixes on the AIL, using RIO. But this is already a requirement even if DHCPv6-PD is not used or was not successful. So there should be standard code already doing this.
(This PR looks like it wants to modify the PIO. And per the Thread spec, the AIL on-link prefix that a BR creates using PIO is always a ULA prefix, not dependent on DHCPv6-PD in any way.)
@EskoDijk , this PR is probably no longer relevant, as we are switching to using a DHCPv6 Client implemented within OT core.
This PR was an attempt to leverage dhcpcd and communicate the PD prefix using RA message format. Those RAs would never be sent on the AIL.
@EskoDijk , this PR is probably no longer relevant, as we are switching to using a DHCPv6 Client implemented within OT core.
This PR was an attempt to leverage dhcpcd and communicate the PD prefix using RA message format. Those RAs would never be sent on the AIL.
Ok good to know! It seems to encode the PD prefix(es) in the radvd config format which kind of suggested radvd would use it.
Ok good to know! It seems to encode the PD prefix(es) in the radvd config format which kind of suggested radvd would use it.
Yes, the radvd config was specifying the wpan (i.e. Thread) interface.