Skip to content

Conversation

yangsong-cnyn
Copy link
Contributor

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.

Copy link

codecov bot commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

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     

☔ View full report in Codecov by Sentry.
📢 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 yangsong-cnyn marked this pull request as ready for review February 28, 2025 09:00
@yangsong-cnyn yangsong-cnyn requested a review from bukepo February 28, 2025 09:00
@yangsong-cnyn yangsong-cnyn marked this pull request as draft March 19, 2025 01:27
Copy link
Member

@bukepo bukepo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any new tests added to cover the changes?

@superwhd superwhd removed their request for review August 13, 2025 02:06
@EskoDijk
Copy link

@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.)

@jwhui
Copy link
Member

jwhui commented Sep 25, 2025

@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
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants