mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6461] [MERGED] fix(amneziawg): honor inbound listen when binding UDP socket #6282
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6282
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/MHSanaei/3x-ui/pull/6461
Author: @mrchatam
Created: 9/11/2026
Status: ✅ Merged
Merged: 9/12/2026
Merged by: @MHSanaei
Base:
main← Head:fix/amneziawg-listen-bind📝 Commits (3)
b97fdfbfix(amneziawg): honor inbound listen when binding UDP socket1addc08fix(amneziawg): fall back to wildcard when listen is unusable922fa32fix(amneziawg): use ListenConfig.ListenPacket for noctx📊 Changes
10 files changed (+379 additions, -17 deletions)
View changed files
📝
internal/amneziawg/instance.go(+1 -0)📝
internal/amneziawg/instance_test.go(+4 -1)📝
internal/amneziawg/types.go(+5 -2)📝
internal/amneziawgnet/client_device.go(+2 -1)📝
internal/amneziawgnet/device.go(+2 -1)📝
internal/amneziawgnet/manager.go(+4 -4)➕
internal/amneziawgnet/pinned_bind.go(+188 -0)➕
internal/amneziawgnet/pinned_bind_test.go(+160 -0)📝
internal/amneziawgnet/resolving_bind.go(+4 -4)📝
internal/amneziawgnet/resolving_bind_test.go(+9 -4)📄 Description
Summary
listenand always bound0.0.0.0/::viaawgconn.NewDefaultBind(), so multi-IP hosts replied from the primary address and clients connecting to a secondary IP never completed the handshake.Inbound.Listenonamneziawg.Instance, open apinnedBindfor non-wildcard listen values (empty /0.0.0.0/::keep the default bind), and include listen inaddressFingerprintso edits rebuild the Device instead of hot-applying an unchangeable Bind.Test plan
go test ./internal/amneziawg/ ./internal/amneziawgnet/listen: SECONDARY_IP, add a client, confirmss -lunpshows the socket bound to that address onlySECONDARY_IP:portcompletes; replies source fromSECONDARY_IP0.0.0.0listen still binds all addresses as beforeFixes #6367
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.