From 7fae703a2741d2b0c7472fecb1c7f82ce5b28357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Mon, 18 May 2026 10:25:18 +0200 Subject: [PATCH] [client/ui] Port IPv6 toggle and paired default-route filter to Wails UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Brings two main-side PRs' UI behavior across the Fyne→Wails rewrite: - #5631 (IPv6 overlay support): add "Enable IPv6" row to the polished SettingsNetwork tab; the legacy screens/Settings.tsx already had it, but modules/settings/SettingsNetwork.tsx (the user-visible Settings window) was missing the toggle. - #6150 (mirror v4 exit selection onto v6 pair): replace the literal "0.0.0.0/0" || "::/0" filter in screens/Networks.tsx with an isDefaultRoute() helper that handles the daemon's merged-range display string (e.g. "0.0.0.0/0, ::/0"), so paired v4/v6 exit nodes are classified correctly. --- .../frontend/src/modules/settings/SettingsNetwork.tsx | 6 ++++++ client/ui/frontend/src/screens/Networks.tsx | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/client/ui/frontend/src/modules/settings/SettingsNetwork.tsx b/client/ui/frontend/src/modules/settings/SettingsNetwork.tsx index 79bb09837..9eef37dc8 100644 --- a/client/ui/frontend/src/modules/settings/SettingsNetwork.tsx +++ b/client/ui/frontend/src/modules/settings/SettingsNetwork.tsx @@ -45,6 +45,12 @@ export function SettingsNetwork() { label={"Enable Server Routes"} helpText={"Advertise this host's local routes to other peers."} /> + setField("disableIpv6", !v)} + label={"Enable IPv6"} + helpText={"Use IPv6 addressing for the NetBird overlay network."} + /> ); diff --git a/client/ui/frontend/src/screens/Networks.tsx b/client/ui/frontend/src/screens/Networks.tsx index 5fa7a31cc..7e82d71a6 100644 --- a/client/ui/frontend/src/screens/Networks.tsx +++ b/client/ui/frontend/src/screens/Networks.tsx @@ -55,7 +55,7 @@ export default function Networks() { const overlapping = useMemo(() => filterOverlapping(routes), [routes]); const exitNodes = useMemo( - () => routes.filter((r) => r.range === "0.0.0.0/0" || r.range === "::/0"), + () => routes.filter((r) => isDefaultRoute(r.range)), [routes], ); @@ -146,6 +146,15 @@ function NetworkList({ ); } +// range is the merged display string from the daemon, e.g. "0.0.0.0/0", +// "::/0", or "0.0.0.0/0, ::/0" when a v4 exit node has a paired v6 entry. +function isDefaultRoute(range: string): boolean { + return range.split(",").some((part) => { + const trimmed = part.trim(); + return trimmed === "0.0.0.0/0" || trimmed === "::/0"; + }); +} + function filterOverlapping(routes: Network[]): Network[] { const byRange = new Map(); for (const r of routes) {