Commit Graph

2968 Commits

Author SHA1 Message Date
Viktor Liu
9f7233f6af Fix ipv6 capture output 2026-05-06 16:22:34 +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
Pascal Fischer
bfeb9b19ec [management] remove permissions from geolocations api (#6091) 2026-05-06 13:07:01 +02:00
Viktor Liu
b5b75b4e72 Merge branch 'main' into proto-ipv6-overlay 2026-05-06 12:22:28 +02:00
Pascal Fischer
b19b7464ea [management] fix flaky invite token test (#6077) v0.70.5 2026-05-05 18:48:51 +02:00
Pascal Fischer
cfb1b3fe31 [proxy] consolidate mapping update (#6072) 2026-05-05 18:40:42 +02:00
Bethuel Mmbaga
3c28d29725 [management] Map Entra oid claim as Dex user ID (#6067) 2026-05-05 18:12:18 +03:00
Nicolas Frati
1795bc801d chores: updated discussions and issues templates (#6073) 2026-05-05 07:53:01 -07:00
Viktor Liu
31395f8bd2 [client] Use fwmark-aware route lookup for raw socket UDP checksum source (#6070)
* Use fwmark-aware route lookup for raw socket UDP checksum source

* Guard nil raw socket in sharedsock WriteTo
2026-05-05 16:18:22 +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
Pascal Fischer
97db824929 [management] fix proxy reconnect (#6063) 2026-05-04 20:43:25 +02:00
Viktor Liu
77a0992dc2 [misc] Disable govet inline analyzer and tidy go.mod (#6066) 2026-05-05 02:59:41 +09: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
a547fc74ed [client] Use ctx.Err() instead of gRPC codes.Canceled to detect shutdown (#6019)
Detecting shutdown by inspecting the gRPC status code conflates a local
context cancellation with a server- or proxy-sent codes.Canceled. When
the latter occurs (e.g. an intermediary proxy resets the stream), the
retry loop silently terminates and the client never reconnects.

Switch to ctx.Err() in the signal Receive loop and management Sync/Job
handlers, and stop matching gRPC Canceled/DeadlineExceeded in the flow
client's isContextDone helper. With this change, a server-sent Canceled
is treated as a transient error and the backoff retry loop continues.
2026-05-04 11:59:25 +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
469eba0cc2 Soft-fail All-group lookup during peer IPv6 allocation 2026-05-04 11:56:50 +02:00
Viktor Liu
55f3285342 Validate bracket pairing on nameserver IP before stripping 2026-05-04 11:56:26 +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