mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2026-10-13 21:34:25 +00:00
[PR #153] conn: fall back to per-packet send/recv when sendmmsg/recvmmsg are ENOSYS #171
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/amneziawg-go#171
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/amnezia-vpn/amneziawg-go/pull/153
Author: @william-aqn
Created: 7/12/2026
Status: 🔄 Open
Base:
master← Head:sendmmsg-enosys-fallback📝 Commits (1)
ccb824dconn: fall back to per-packet send/recv when sendmmsg/recvmmsg are ENOSYS📊 Changes
1 file changed (+42 additions, -18 deletions)
View changed files
📝
conn/bind_std.go(+42 -18)📄 Description
wireguard-go/amneziawg-go's StdNetBind uses ipv{4,6}.PacketConn WriteBatch/ ReadBatch (sendmmsg/recvmmsg) on Linux for batched UDP I/O. Those syscalls were added in Linux 3.0; on older kernels still shipped by some routers (e.g. Broadcom BCM470x / RT-AC68U on 2.6.36) they return ENOSYS, so the tunnel could form handshakes but not send or receive a single packet — it came up and never handshaked, on any config.
Detect ENOSYS from the first WriteBatch/ReadBatch, set a sticky per-bind flag, and fall back to the per-packet WriteMsgUDP/ReadMsgUDP path the non-Linux branch already uses. No effect on kernels >= 3.0 (the flag never trips). Builds on linux/windows/darwin; conn tests pass.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.