Зеркало Leadaxe/wireguard-go-awg2-lx — сабмодуль ядра sing-box-lx (AmneziaWG). GPLv3.
Find a file
Leadaxe 1e787bb3e0 lx: gate reserved-byte clear on receive so AmneziaWG magic survives
The Cloudflare "reserved" bytes (1-3) were zeroed unconditionally on
every received datagram across all StdNetBind/WinRingBind receive paths.
AmneziaWG reads its magic header as LittleEndian.Uint32(packet[padding:])
where padding is s1/s2/s4; with small padding (0-3) the magic overlaps
bytes 1-3, so clearing them collapses it out of the ranged h1-h4 window
and every packet is dropped (handshake included) — the AWG endpoint
never comes up. Plain WG (types 1-4, bytes 1-3 already zero) and large
padding are unaffected, which is why it went unnoticed.

Gate all five receive clears (bind_std receiveIP, msgx_darwin
receiveSingle + makeReceiveMsgX, bind_windows receiveIPv4/v6) behind a
new hasReserved() so bytes 1-3 are only touched when a WARP reserved
value is actually configured. Send paths already gate on a per-endpoint
loaded/non-zero check, so they are left unchanged. The reserved map is
populated before the receive goroutines start and never mutated after,
so the lock-free read is safe.

Tests: awg_stdnetbind_reserved_lx_test.go brings up two Devices over
StdNetBind with zero padding (magic in bytes 0-3) and asserts delivery
(red before the fix, green after); reserved_gate_lx_test.go pins the
hasReserved() gate.
2026-08-05 16:55:02 +03:00
conn lx: gate reserved-byte clear on receive so AmneziaWG magic survives 2026-08-05 16:55:02 +03:00
device lx: gate reserved-byte clear on receive so AmneziaWG magic survives 2026-08-05 16:55:02 +03:00
ipc Rename module 2026-05-17 20:09:28 +08:00
ratelimiter Remove unused 2026-05-17 20:04:34 +08:00
replay Remove unused 2026-05-17 20:04:34 +08:00
rwcancel rwcancel: fix wrong poll event flag on ReadyWrite 2025-05-05 15:10:08 +02:00
tai64n Remove unused 2026-05-17 20:04:34 +08:00
tun Apply Tailscale TUN offload APIs 2026-05-17 20:36:35 +08:00
.gitignore Update .gitignore 2026-05-17 20:02:24 +08:00
go.mod device: add API for on-demand configuration of peers 2026-08-04 19:06:30 +08:00
go.sum Add pause support 2026-05-17 20:36:45 +08:00
LICENSE mod: rename COPYING to LICENSE 2021-03-06 09:09:21 -07:00
Makefile Makefile: don't use test -v because it hides failures in scrollback 2021-11-16 21:07:31 +01:00
reformat.sh Add module rename script 2026-05-17 20:02:24 +08:00
remove-unused.sh Add remove unused script 2026-05-17 20:02:24 +08:00
rename-module.sh Add module rename script 2026-05-17 20:02:24 +08:00
version.go version: bump snapshot 2025-05-22 01:45:02 +02:00