Skip to content

fix DNS update on IPv6-triggered WAN switch#1855

Merged
jasonlyc merged 2 commits into
firewalla:masterfrom
yijin-png:yijinhu/fix-dual-wan-dns-failover
May 14, 2026
Merged

fix DNS update on IPv6-triggered WAN switch#1855
jasonlyc merged 2 commits into
firewalla:masterfrom
yijin-png:yijinhu/fix-dual-wan-dns-failover

Conversation

@yijin-png
Copy link
Copy Markdown
Contributor

No description provided.

@j-sallyjin

This comment has been minimized.

@j-sallyjin
Copy link
Copy Markdown

PR Review Summary

✅ What looks good

  • Adds _applyActiveGlobalDefaultRoutingAndNotify() to centralize WAN-switch notification behavior.
  • Keeps IPv6-triggered route re-application publishing EVENT_WAN_SWITCHED only when the active WAN set/order changes.
  • Uses ordered active WAN names for comparison, which is better than only checking count or truthiness.
  • PR metadata was accessible; title is fix DNS update on IPv6-triggered WAN switch. No linked issue found in title/body/comments.

⚠️ Issues found

  • No linked issue found.

  • Medium — notification may be missed when _wanStatus is updated before comparison.
    In the apply() path, this._wanStatus = wanStatus happens before _applyActiveGlobalDefaultRoutingAndNotify(false) is called. Since _applyActiveGlobalDefaultRouting() captures activeWANsBefore from this._wanStatus, the “before” snapshot may already contain the new active WAN state, making wanSwitched false even when the active WAN changed. If this path is expected to emit EVENT_WAN_SWITCHED, capture the old active WANs before assigning this._wanStatus, or pass the previous active WAN list into the helper.

💡 Suggestions

  • Add regression coverage for:
    • IPv6 route recalculation changes active WAN → emits EVENT_WAN_SWITCHED
    • regular apply() changes active WAN → emits EVENT_WAN_SWITCHED
    • route recalculation without active WAN change → does not emit
  • Consider logging active WAN arrays with JSON.stringify() to avoid ambiguous comma-joined output.

Verdict

REQUEST_CHANGES


Repo: firewalla/firerouter
PR: #1855
Head SHA: a5776a86362759f1ddf408ed8a07356c92b8a914
Checked at: 2026-05-12 11:16:56 CST

@jasonlyc jasonlyc merged commit 0063539 into firewalla:master May 14, 2026
1 check passed
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.

3 participants