mirror of
https://github.com/amnezia-vpn/amneziawg-linux-kernel-module.git
synced 2026-10-13 21:34:34 +00:00
[PR #232] [MERGED] fix: do not append random trailers to I1-I5 and dummy junk packets #246
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-linux-kernel-module#246
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-linux-kernel-module/pull/232
Author: @v1l3nk4
Created: 9/6/2026
Status: ✅ Merged
Merged: 9/6/2026
Merged by: @ygurov
Base:
master← Head:fix/random-trailers-ipackets📝 Commits (1)
90fee83fix: do not append random trailers to I1-I5 and dummy junk packets📊 Changes
3 files changed (+9 additions, -7 deletions)
View changed files
📝
src/send.c(+4 -4)📝
src/socket.c(+4 -2)📝
src/socket.h(+1 -1)📄 Description
Fixes https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/issues/231
What
Stop appending random trailers to the
I1-I5special junk packets and to theJcdummy junk. Handshake initiation, handshake response, cookie reply andtransport padding are unchanged.
Why
I1-I5are operator-supplied byte-exact covers. A random tail does notobscure their shape, it destroys it and replaces it with something the imitated
protocol can never produce: a valid prefix followed by bytes that protocol never
carries. For the dummy junk the trailer is simply redundant, its length is
already drawn from
[Jmin, Jmax].amneziawg-go already does this
Checked at
b5928efb6ca19f0153958460c3d141f04abc5c2e: I-packets are queued asmake([]byte, ipacket.ObfuscatedLen(0))with no trailer term(
device/send.go:139-144), andrandomTrailer()is called only for handshakeinit (
:150), response (:200), cookie reply (:259) and transport padding(
:609).JunkPackets()is untouched too. So the same.confcurrently givesa different wire footprint depending on which implementation runs it. This makes
the kernel module match Go.
How
wg_socket_send_buffer_to_peer()gains abool trailerargument. The four callsites in
send.cpassfalsefor the ispec loop and the dummy junk,trueforthe two handshake messages.
+9 -7acrosssend.c,socket.c,socket.h.No UAPI, netlink or wire-format change: I-packets and dummy junk are never
parsed by the receiver, so patched and unpatched ends interoperate unchanged.
Testing
Builds clean with no new warnings against
6.12.107+deb13-amd64.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.