wireguard-go-awg2-lx/conn
Leadaxe 9a23f36748 lx: re-graft egress-provider API onto AWG2 base (upstream 6f5e8b1947)
Upstream wireguard-go added an EgressProvider hook to StdNetBind (egress
anchoring for TUN auto-redirect): EgressProvider interface, egressProvider
field, SetEgressProvider, plus egress branches in Open/Send/Close and a
standardEndpoint cast hoist in Send. sing-box's endpoint-listen refactor
now calls StdNetBind.SetEgressProvider, so our AWG2 fork (which was one
wireguard-go revision behind) failed to build.

Applied the upstream delta to conn/bind_std.go verbatim, then re-applied
SPEC 026: gate BOTH reserved-clear sites behind hasReserved() —

  - main receiveIP path (msg.N > 3 && s.hasReserved())    [existing]
  - NEW egress receive path (dataLength > 3 && s.hasReserved())

Upstream's egress hook re-introduced an UNCONDITIONAL common.ClearArray(
bufs[0][1:4]) — the exact anti-pattern SPEC 026 fixed. Gating it keeps a
small-padding AmneziaWG magic (bytes 1-3) intact when no WARP reserved
value is set, and STILL fires for WARP-over-egress: the egress bind is
only created on the isUDPListener path, where SetReservedForEndpoint is
called for every peer, so hasReserved() is true in that scenario. Verified:
WARP egress unaffected, AWG magic survives, conn tests green.

reservedForEndpoint is populated before receive goroutines start and never
mutated after (same lock-free invariant SPEC 026 already relies on).
2026-08-05 16:55:31 +03:00
..
winrio global: bump copyright notice 2025-05-05 15:05:35 +02:00
bind_std.go lx: re-graft egress-provider API onto AWG2 base (upstream 6f5e8b1947) 2026-08-05 16:55:31 +03:00
bind_windows.go lx: gate reserved-byte clear on receive so AmneziaWG magic survives 2026-08-05 16:55:02 +03:00
boundif_android.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
conn.go Export std net bind 2026-05-17 20:36:46 +08:00
controlfns.go Export std net bind 2026-05-17 20:36:46 +08:00
controlfns_linux.go conn: don't enable GRO on Linux < 5.12 2025-05-22 01:43:39 +02:00
controlfns_unix.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
controlfns_windows.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
default.go Export std net bind 2026-05-17 20:36:46 +08:00
errors_default.go global: replaced unused function params with _ 2025-05-05 15:10:08 +02:00
errors_linux.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
features_default.go global: replaced unused function params with _ 2025-05-05 15:10:08 +02:00
features_linux.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
gso_default.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
gso_linux.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
mark_default.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
mark_unix.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
msgx_darwin.go lx: gate reserved-byte clear on receive so AmneziaWG magic survives 2026-08-05 16:55:02 +03:00
msgx_default.go Add batched UDP I/O on Darwin via sendmsg_x/recvmsg_x 2026-07-06 21:06:55 +08:00
reserved_gate_lx_test.go lx: gate reserved-byte clear on receive so AmneziaWG magic survives 2026-08-05 16:55:02 +03:00
sticky_default.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
sticky_linux.go global: bump copyright notice 2025-05-05 15:05:35 +02:00