mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2026-10-13 21:34:25 +00:00
[PR #122] [CLOSED] fix: handle ErrUDPGSODisabled in handshake send paths (kernel 6.17 regression) #150
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#150
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/122
Author: @crispuscrew
Created: 3/9/2026
Status: ❌ Closed
Base:
master← Head:master📝 Commits (1)
f61b5edfix, auto test & manual test📊 Changes
2 files changed (+155 additions, -0 deletions)
View changed files
➕
device/gso_fallback_test.go(+141 -0)📝
device/send.go(+14 -0)📄 Description
Fixes #119
Problem
On Linux kernel 6.17 (Fedora 41),
sendmmsgreturnsEINVALwhen UDP GSO is used. The conn layer correctly catches this, disables GSO, retries without it, and returnsErrUDPGSODisabled{RetryErr: nil}- meaning the packet was actually sent successfully via the fallback path.However,
SendHandshakeInitiationandSendHandshakeResponsetreated any non-nil error fromSendBuffersas fatal. This caused the handshake to fail and the tunnel to never establish, even though the packet went through fine.The error message users saw:
Fix
Mirror the pattern already used in
RoutineSequentialSender: unwrapErrUDPGSODisabledand only propagate the innerRetryErr. IfRetryErris nil (retry succeeded), the error is silently dropped and the handshake proceeds normally.Tests
Unit tests (
device/gso_fallback_test.go):TestSendHandshakeInitiationGSODisabledFallback— wraps the bind to returnErrUDPGSODisabled{RetryErr: nil}on the first Send call, asserts thatSendHandshakeInitiationreturns nil.TestSendHandshakeResponseGSODisabledFallback— same forSendHandshakeResponse, asserts thatErrUDPGSODisabledis not leaked.Both tests fail on the unpatched code and pass after the fix.
Integration test (manual, Linux kernel 6.17.10, Fedora 41):
Ran the userspace
amneziawg-godaemon (WG_PROCESS_FOREGROUND=1) against a real AmneziaWG server with full obfuscation config (jc=3, jmin=10, jmax=30, s1-s4, h1-h4). Verified via UAPI query thatlast_handshake_time_secis non-zero and bothtx_bytes/rx_bytesare exchanged - tunnel established successfully. Before the fix, the handshake failed and no traffic flowed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.