Commit Graph

1272 Commits

Author SHA1 Message Date
Viktor Liu
4cd2651989 Merge branch 'main' into proto-ipv6-overlay 2026-05-07 11:15:47 +02:00
Zoltan Papp
f23aaa9ae7 [client] iOS: structured ResolvedIPs collection for domain routes (#6090)
* [client] iOS: structured ResolvedIPs collection for domain routes

Replace comma-joined ResolvedIPs string with a gomobile-friendly
ResolvedIPs collection (Add/Get/Size), mirroring the Android bridge
in client/android/network_domains.go.

This allows the iOS app to match domain-route resolved IPs against
connected peer routes without parsing CSV strings, fixing the route
status indicator for dynamic (DNS) routes.

* [client] iOS: align dynamic route exposure with Android bridge

For dynamic (DNS) routes the Swift side previously received
"invalid Prefix" as the Network value, forcing UI code to special-case
that sentinel. The Android bridge uses Domains.SafeString() instead so
peer.routes entries (which also derive from Domains.SafeString()) match
directly. Mirror that here.

Also fix the resolved IP lookup: resolvedDomains is keyed by the
resolved domain (e.g. api.ipify.org), not the configured pattern
(e.g. *.ipify.org). Group entries by ParentDomain like the daemon does
in client/server/network.go, so wildcard route patterns get their
resolved IPs populated.
2026-05-06 17:14:11 +02:00
Viktor Liu
3722dc66c6 Merge branch 'main' into proto-ipv6-overlay
# Conflicts:
#	client/internal/debug/debug_test.go
2026-05-06 15:36:36 +02:00
Viktor Liu
f532976e05 [client] Add public key to debug bundle config.txt (#6092) 2026-05-06 13:42:47 +02:00
Viktor Liu
71a400f90f [client] Include MTU and SSH auth/JWT cache config in debug bundle (#6071) 2026-05-06 13:23:43 +02:00
Viktor Liu
2d36ee6d34 Merge branch 'main' into proto-ipv6-overlay 2026-05-05 15:31:06 +02:00
Viktor Liu
cd8e71002f [client] Bump go-netroute to v0.4.0 and drop fork (#6062) 2026-05-05 15:26:27 +02:00
JungwooShin
104990dfdd [client] Display QR code for device auth login URL (#5415) 2026-05-04 18:59:29 +02:00
alexsavio
bde632c3b2 [client] Replace WG interface monitor polling with netlink subscription on Linux (#5857) 2026-05-04 18:49:39 +02:00
Lauri Tirkkonen
4268a5cfb7 [client] Use atomic write/rename pattern for ssh config 2026-05-04 18:24:52 +02:00
Viktor Liu
2cd11eb5d9 Fix lint: replace maps.Clear with clear, drop unused server wrapper, add v6 ext-header TODO 2026-05-04 13:57:19 +02:00
Viktor Liu
3ebd47f88d Use previous DNS-route mode when removing existing rules during mode switch 2026-05-04 13:50:40 +02:00
Viktor Liu
2394972131 Reject out-of-range UDP port before narrowing to uint16 in fakeAddress 2026-05-04 13:40:00 +02:00
Viktor Liu
14ef880fc1 Always remove invalid-routed block rules in DisableRouting 2026-05-04 13:39:13 +02:00
Viktor Liu
3ce048ebe7 Update blockInvalidRouted tests for slice return type 2026-05-04 13:34:20 +02:00
Viktor Liu
b828b2bf88 Replace maps.Clear with builtin clear; fix appendAssign in test 2026-05-04 12:34:08 +02:00
Viktor Liu
5ba9882fd4 Split IPv6 extension walker case clause into helpers 2026-05-04 12:29:42 +02:00
Viktor Liu
b2d61f3b0b Use nat table for PREROUTING chain in xtables DNAT fallback 2026-05-04 12:29:14 +02:00
Viktor Liu
6dbe3d82d1 Allow ICMPv6 Parameter Problem through peer ACL 2026-05-04 12:28:53 +02:00
Viktor Liu
63bb85cdf2 Keep v4 NAT rule when v6 mirror fails to preserve partial connectivity 2026-05-04 12:28:36 +02:00
Viktor Liu
e4feefb9a6 Track v4 and v6 invalid-routed block rules so DisableRouting cleans both 2026-05-04 12:28:10 +02:00
Viktor Liu
2a37aca62e Refresh nftables rule maps only when neither cached map locates the rule 2026-05-04 12:25:34 +02:00
Viktor Liu
adb5df258c Walk IPv6 extension headers when intercepting ICMPv6 directly 2026-05-04 12:16:39 +02:00
Viktor Liu
5f3aef3198 Validate IP-declared lengths before synthesizing direct ICMP packet 2026-05-04 12:12:45 +02:00
Viktor Liu
1b2d7777a3 Skip iOS SetInterfaceIPv6 when no IPv6 overlay address is assigned 2026-05-04 12:12:05 +02:00
Viktor Liu
ad30faed5f Log v6 prefix decode failure at error level instead of warn 2026-05-04 12:10:18 +02:00
Viktor Liu
d7b971e157 Merge remote-tracking branch 'origin/main' into proto-ipv6-overlay
# Conflicts:
#	client/internal/peer/status.go
2026-05-04 12:08:38 +02:00
Viktor Liu
ecf987c5b5 Use isDefaultRoute helper for exit node detection in UI 2026-05-04 12:03:31 +02:00
Viktor Liu
bcf006581d Roll back nftables init via deferred cleanup on any failure 2026-05-04 12:03:05 +02:00
Zoltan Papp
a21f6ecb0a [client] release Status.mux before invoking notifier callbacks (#6039)
The Status recorder used to fire notifier callbacks while holding d.mux:
- notifyPeerListChanged / notifyPeerStateChangeListeners ran from inside
  the locked section of every Update*/AddPeerStateRoute/etc.
- notifyAddressChanged ran from UpdateLocalPeerState and CleanLocalPeerState
  while d.mux was held.
- onConnectionChanged was registered with a defer above defer d.mux.Unlock,
  so it executed before the mutex was released in the Mark*Connected/
  Disconnected helpers.
- notifyPeerStateChangeListeners did a blocking channel send under d.mux,
  so a slow subscriber stalled every other d.mux holder.

A listener that re-enters the recorder (e.g. calls GetFullStatus from
within a callback) deadlocks against d.mux, and any callback that takes
longer than expected stalls every other state query for its duration.

Capture the values needed for notification under the lock, release d.mux,
then call the notifier. Build per-peer router-state snapshots inside the
lock and dispatch them via dispatchRouterPeers afterwards. The router-peer
channel send stays blocking, but now happens outside d.mux so a slow
consumer cannot stall any other d.mux holder, and no peer state
transitions are silently dropped.

The notifier itself is unchanged: its internal state was already protected
by its own locks, and the field d.notifier is set once in NewRecorder and
never reassigned, so reading it without d.mux is safe.

Also fix a pre-existing race in Test_notifier_RemoveListener /
Test_notifier_SetListener: setListener spawns a goroutine that writes
listener.peers, but the tests read listener.peers without waiting for it.
2026-05-04 11:59:01 +02:00
Viktor Liu
006d925d9c Use family-specific protocol token in iptables AddOutputDNAT 2026-05-04 11:57:18 +02:00
Viktor Liu
15070f0b13 Return error from trace selfAddr when no overlay address for family 2026-05-04 11:55:19 +02:00
Viktor Liu
03ac436d02 Guard v6 exit node merge against empty companion routes slice 2026-05-04 11:54:58 +02:00
Viktor Liu
d2d6e14b9e Guard isOwnAddress against nil wgInterface 2026-05-04 11:54:36 +02:00
Viktor Liu
b01a7da44f Clear anonymized IPv6 address when prefix encode fails 2026-05-04 11:52:33 +02:00
Viktor Liu
d8a5bdab88 Guard MSS clamp precompute against MTU smaller than TCP/IP header overhead 2026-05-04 11:52:16 +02:00
Viktor Liu
5cb82b26c8 Decode ICMP error payload using family-specific minimum length 2026-05-04 11:51:49 +02:00
Viktor Liu
61c64caf69 Skip nftables MSS clamping when MTU is below header overhead 2026-05-04 11:50:38 +02:00
Viktor Liu
0ce2d7406a Roll back v4 NAT rule when v6 mirror fails in nftables AddNatRule 2026-05-04 11:50:17 +02:00
Viktor Liu
fc34db6db1 Validate ip6tables-save stderr in nftables compatibility test 2026-05-04 11:49:47 +02:00
Viktor Liu
35332d6aa3 Merge remote-tracking branch 'origin/main' into proto-ipv6-overlay
# Conflicts:
#	client/firewall/uspfilter/forwarder/endpoint.go
#	client/wasm/cmd/main.go
#	proxy/cmd/proxy/cmd/debug.go
2026-05-04 11:40:41 +02:00
Viktor Liu
50b58a6828 [client, relay] Advertise relay server IP via signal for foreign-relay fallback dial (#6004) 2026-05-04 11:40:25 +02:00
Viktor Liu
057d651d2e [client, proxy] Add packet capture to debug bundle and CLI (#5891) 2026-05-04 11:28:56 +02:00
Maycon Santos
3fc5a8d4a1 [misc] fix MSI generation add installer tests (#6031)
Add Windows installer build test workflow
2026-04-29 23:44:38 +02:00
Viktor Liu
ed828b7af4 Tolerate EEXIST when adding macOS scoped default routes (#6027) 2026-04-29 16:08:47 +02:00
Viktor Liu
11ac2af2f5 Use BindListener for all userspace bind in lazyconn activity (#6028) 2026-04-29 16:07:33 +02:00
Bethuel Mmbaga
df197d5001 [management] Prevent JWT reuse during peer login (#6002) 2026-04-29 15:04:27 +03:00
shuuri-labs
ad93dcf980 [client] Enable UI autostart for silent and MSI installs (#6026)
* fix(client): enable UI autostart for silent and MSI installs

The MSI installer had no autostart logic and the EXE silent installer
skipped the autostart page, leaving the registry entry unwritten. This
caused the NetBird UI tray to not start at login after RMM deployments.

Add an AUTOSTART property (default: 1) to the MSI that writes the
HKLM Run key, and initialize AutostartEnabled in the NSIS .onInit so
silent installs match the interactive default.

* add real guid for NetBirdAutoStart component
2026-04-29 13:14:46 +02:00
Viktor Liu
28fe26637b [client] Fix Windows installer upgrade detection for pre-0.70.1 installs (#6025) 2026-04-29 11:01:07 +02:00
Viktor Liu
c30f081d67 Merge branch 'main' into proto-ipv6-overlay
# Conflicts:
#	client/proto/daemon.pb.go
2026-04-29 10:09:34 +02:00