Skip to content

SHARMAN-4397 : Implement IPv6 DAD recovery mechanism and enhance addr… - #233

Merged
guto86 merged 2 commits into
mainfrom
bugfix/dad-failure-heal
Oct 15, 2026
Merged

guto86 merged 2 commits into
mainfrom
bugfix/dad-failure-heal

Conversation

@S-Parthiban-Selvaraj

Copy link
Copy Markdown
Contributor

…ess event logging

@S-Parthiban-Selvaraj
S-Parthiban-Selvaraj requested a review from a team as a code owner October 13, 2026 15:45
Copilot AI balanced review requested due to automatic review settings October 13, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Recovery can target unrelated or incorrectly prefixed addresses, report failed DAD as ready, and enter repeated DHCPv6 restart cycles.

2 open findings
What changed in this PR

Adds IPv6 DAD failure visibility and automated WAN address recovery.

Changes:

  • Logs IPv6 netlink address flags and DAD failures.
  • Re-adds failed addresses and restarts DHCPv6 when recovery fails.
  • Tracks recovery attempts across lease processing.
File Description
source/​WanManager/​wanmgr_network_monitor.c Logs address flags and DAD failures.
source/​WanManager/​wanmgr_interface_sm.c Implements DAD recovery and DHCPv6 restart.
source/​WanManager/​wanmgr_dhcp_event_handler.c Resets recovery state for lease updates.
source/​TR-181/​include/​wanmgr_dml.h Adds DAD recovery state.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread source/WanManager/wanmgr_dhcp_event_handler.c
Comment thread source/WanManager/wanmgr_interface_sm.c
guto86
guto86 previously approved these changes Oct 15, 2026
Copilot AI balanced review requested due to automatic review settings October 15, 2026 14:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Recovery can disrupt healthy addresses, lose address lifetimes, and report readiness with stale lease state.

4 open findings
Previously missed (2)

In code that hasn't changed since last review

Medium severity Reset the DAD recovery guard at lease and connection boundaries

source/​WanManager/​wanmgr_dhcp_event_handler.c:251

This reset covers only DHCP Manager lease updates. The legacy wanmgr_handle_dhcpv6_event_data() and SLAAC netlink handler install replacement addresses without clearing the flag, and WanManager_ClearDHCPData() leaves it set during teardown. After one unsuccessful recovery, another failing address can therefore skip both recovery stages. Reset the guard at genuine new-lease/address and connection-reset boundaries in those paths as well; do not reset it merely for notifications generated by recovery itself.

Medium severity Preserve IPv6 address lifetimes during DAD recovery

source/​WanManager/​wanmgr_interface_sm.c:1130

Re-adding the address without valid_lft and preferred_lft defaults both lifetimes to forever. If the installed DHCPv6 address has finite lifetimes, recovery removes its kernel expiration and deprecation deadlines. Capture the remaining lifetimes before deletion and preserve those deadlines when re-adding the address, rather than making it permanent.

🧠 Review effort: Balanced

Comment thread source/WanManager/wanmgr_interface_sm.c
Comment thread source/WanManager/wanmgr_interface_sm.c

@biju-vi biju-vi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

approved

@guto86
guto86 merged commit c7e7849 into main Oct 15, 2026
12 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants