Commit Graph

2946 Commits

Author SHA1 Message Date
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
Viktor Liu
fc34db6db1 Validate ip6tables-save stderr in nftables compatibility test 2026-05-04 11:49:47 +02:00
Bethuel Mmbaga
6262b0d841 [management] Track pending approval in peer event metadata (#6040) 2026-05-04 12:47:13 +03: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
Misha Bragin
c4b2da4c92 [management] Add public connection ipv4 and ipv6 posture check (#6038)
This change enables admins to configure posture checks for connecting public IPs of their peers.

It changes the behavior of the check as well and now the evaluation is if the received network is part of the configured network.
2026-04-30 18:36:50 +02:00
Nicolas Frati
dcd1db42ef [management] Enable PAT creation during setup (#6003)
* enable pat creation on setup

* remove logic from handler towards setup service

* fix lint issue

* fix rollback on account id returning empty

* fix coderabbit comments

* fix setup PAT rollback behavior
2026-04-30 17:21:35 +02:00
Pascal Fischer
f29f5a0978 [management] add monitoring for nmap update source (#6036) 2026-04-30 14:52:54 +02:00
Maycon Santos
3fc5a8d4a1 [misc] fix MSI generation add installer tests (#6031)
Add Windows installer build test workflow
v0.70.4
2026-04-29 23:44:38 +02:00
Zoltan Papp
57945fc328 [client] Trigger mobile submodule bump PRs on release tags (#6029)
Trigger mobile submodule bump PRs on release tags
v0.70.3
2026-04-29 17:19:22 +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
Nicolas Frati
7eba5dafd8 [misc] Add comment automation on release workflow for PRs (#6016)
* feat: add comment automation on release workflow for PRs

* update action permissions
v0.70.2
2026-04-29 11:28:55 +02:00
Viktor Liu
ff8d8f6a0e Drop AAAA from netmap when requesting peer lacks IPv6 2026-04-29 11:14:02 +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
Viktor Liu
e55a554c80 Load meta_capabilities in pgx peer loader 2026-04-29 09:58:00 +02:00
Viktor Liu
594f2a484d Look up peers by IPv6 address in GetPeerByIP 2026-04-29 08:14:48 +02:00
Viktor Liu
407e9d304b [client] Move macOS sleep detection into the daemon (purego) (#5926) 2026-04-29 08:09:55 +02:00
Viktor Liu
e5474e199f [client] Use WinRT COM for Windows toasts (#6013)
* Use WinRT COM for Windows toasts instead of fyne's PowerShell path

* Quote autostart path and split HKCU registry into per-user component
v0.70.1
2026-04-28 20:54:06 +02:00