[PR #6150] [client] Mirror v4 exit selection onto v6 pair and honour SkipAutoApply per route #27650

Closed
opened 2026-08-05 07:09:01 -04:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/netbirdio/netbird/pull/6150

State: closed
Merged: Yes


Describe your changes

Fix v4/v6 exit-node pair handling in the route selector so deselecting a v4 exit also drops the synthesized v6 pair, and so management's skip_auto_apply flag is honoured per route. Also fix the GUI exit-node tab filter so paired entries (range string "0.0.0.0/0, ::/0") show up.

  • Read-time mirror in the selector: a *-v6 NetID with no explicit state of its own inherits its v4 base's selection. Legacy persisted state from before v6 pairing transparently applies to the synthesized v6 entry.
  • applyExitNodeFilter now defers to per-route HasUserSelectionForRoute instead of a global "any user selection exists" check, so management's skip_auto_apply always governs untouched routes.
  • Route manager recognises ::/0 as an exit-node route, so v6 exits get categorised and their skip_auto_apply enforced.
  • GUI exit-node tab parses the merged display string ("0.0.0.0/0, ::/0") so paired entries are visible.
  • Tests for v4/v6 mirror semantics, per-route SkipAutoApply enforcement, and v6 exit-node detection.

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Internal client-side selector behaviour fix, no user-facing surface changes.

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

Summary by CodeRabbit

  • Bug Fixes

    • Improved detection and handling of IPv4/IPv6 default (exit-node) routes, including paired v4/v6 displays.
    • Exit-node selection now respects per-route explicit user choices and per-route "skip auto-apply" flags (prevents unintended auto-application).
  • Tests

    • Added tests covering v4/v6 exit-node pairing, per-route skip-auto-apply behavior, and default-route detection.

Review Change Stack

**Original Pull Request:** https://github.com/netbirdio/netbird/pull/6150 **State:** closed **Merged:** Yes --- ## Describe your changes Fix v4/v6 exit-node pair handling in the route selector so deselecting a v4 exit also drops the synthesized v6 pair, and so management's `skip_auto_apply` flag is honoured per route. Also fix the GUI exit-node tab filter so paired entries (range string `"0.0.0.0/0, ::/0"`) show up. - Read-time mirror in the selector: a `*-v6` NetID with no explicit state of its own inherits its v4 base's selection. Legacy persisted state from before v6 pairing transparently applies to the synthesized v6 entry. - `applyExitNodeFilter` now defers to per-route `HasUserSelectionForRoute` instead of a global "any user selection exists" check, so management's `skip_auto_apply` always governs untouched routes. - Route manager recognises `::/0` as an exit-node route, so v6 exits get categorised and their `skip_auto_apply` enforced. - GUI exit-node tab parses the merged display string (`"0.0.0.0/0, ::/0"`) so paired entries are visible. - Tests for v4/v6 mirror semantics, per-route `SkipAutoApply` enforcement, and v6 exit-node detection. ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [x] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) Internal client-side selector behaviour fix, no user-facing surface changes. ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/__ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved detection and handling of IPv4/IPv6 default (exit-node) routes, including paired v4/v6 displays. * Exit-node selection now respects per-route explicit user choices and per-route "skip auto-apply" flags (prevents unintended auto-application). * **Tests** * Added tests covering v4/v6 exit-node pairing, per-route skip-auto-apply behavior, and default-route detection. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/netbirdio/netbird/pull/6150) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
saavagebueno added the pull-request label 2026-08-05 07:09:01 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#27650