Skip to content

fix: clear lingering IPv6 blackhole after exit node deselect - #189

Merged
pappz merged 2 commits into
netbirdio:mainfrom
CicerBro:pr/tvos-ipv6-blackhole
Aug 27, 2026
Merged

fix: clear lingering IPv6 blackhole after exit node deselect#189
pappz merged 2 commits into
netbirdio:mainfrom
CicerBro:pr/tvos-ipv6-blackhole

Conversation

@CicerBro

@CicerBro CicerBro commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What this fixes

After deselecting an IPv6 exit node, traffic could still hit a leftover ::/0 blackhole. NEPacketTunnelNetworkSettings keeps the previous IPv6 configuration when the IPv6 property is left nil on the next setTunnelNetworkSettings call, so the exit-node routes never fully cleared.

Change

Always assign an explicit empty IPv6 settings object when there is no IPv6 config, forcing the system to drop the previous blackhole.

Closes

Summary by CodeRabbit

  • Bug Fixes
    • Prevented outdated IPv6 configuration from being retained when IPv6 routing is not required.
    • Tunnel settings now correctly clear IPv6 configuration when applicable.

setTunnelNetworkSettings keeps the previous IPv6 config when the
property is left nil. Always assign empty IPv6 settings so the ::/0
blackhole from an exit node does not stick after deselection.
Copilot AI lite review requested due to automatic review settings August 10, 2026 19:47
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

createTunnelSettings now assigns empty IPv6 settings when no IPv6 address or default-route blackhole is required. This prevents previously applied IPv6 configuration from remaining active.

Changes

IPv6 tunnel settings

Layer / File(s) Summary
Clear unused IPv6 configuration
NetbirdNetworkExtension/PacketTunnelProviderSettingsManager.swift
createTunnelSettings assigns empty NEIPv6Settings when no IPv6 configuration is required.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

Possibly related PRs

  • netbirdio/ios-client#128 — Both changes update PacketTunnelProvider IPv6 default-route handling and clearing behavior.

Suggested reviewers: lixmal

Poem

A rabbit hops through IPv6 snow,
Finds old routes that should not show.
Empty settings clear the way,
Fresh tunnel paths begin today.
Hop, hop, no stale tracks remain!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change addresses the linked tvOS routing failures by clearing retained IPv6 blackhole settings after exit node deselection [#188, #7132].
Out of Scope Changes check ✅ Passed The six added lines are limited to clearing stale IPv6 tunnel settings and align with the linked routing objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly and concisely describes the fix for the lingering IPv6 blackhole after exit node deselection.
Description check ✅ Passed The description explains the issue, cause, fix, and linked references, but uses custom headings instead of the template's ## Description heading.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI 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.

Pull request overview

This PR addresses a tvOS-specific NetworkExtension behavior where leaving NEPacketTunnelNetworkSettings.ipv6Settings as nil can cause the system to retain previously-applied IPv6 configuration (including a lingering ::/0 blackhole) after an IPv6 exit node is deselected.

Changes:

  • Updates tunnel settings construction to always set ipv6Settings even when there is no active IPv6 configuration, aiming to force the system to clear stale IPv6 state.

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

Comment thread NetbirdNetworkExtension/PacketTunnelProviderSettingsManager.swift
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@pappz

pappz commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

@CicerBro please update the title of the PR. The patch valid for tv and iOS too

@pappz

pappz commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

/testflight

@github-actions

Copy link
Copy Markdown

TestFlight builds uploaded 0.3.4 (22) for 4a53cf3 — iOS + tvOS

View workflow run

@CicerBro CicerBro changed the title fix(tvOS): clear lingering IPv6 blackhole after exit node deselect fix: clear lingering IPv6 blackhole after exit node deselect Aug 24, 2026
@pappz
pappz merged commit 83ed26e into netbirdio:main Aug 27, 2026
9 checks 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.

[tvOS] Exit routing and interface broken tvOS: Exit routing and app UI totally broken

3 participants