mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-16 10:05:00 +03:00
fix(amneziawg): keep port forwards per inbound and off future relay ports
Attach and BulkAttach copied a client record's forwardedPorts onto the target inbound. A client a node reports keeps the forwards the node chose, so attaching it to one of the master's AmneziaWG inbounds opened listeners of the node's choosing on the master, among them the loopback relay port a later AmneziaWG or TUIC inbound derives from its id; that inbound's traffic then went to the forward and Xray failed to bind. A forward is set per inbound and is no longer carried by an attach, and creating an AmneziaWG or TUIC inbound is refused while a peer forward already holds its relay port.
This commit is contained in:
@@ -111,6 +111,8 @@ func (s *ClientService) BulkAttach(inboundSvc *InboundService, emails []string,
|
||||
continue
|
||||
}
|
||||
client := *rec.ToClient()
|
||||
// Forwards are set per inbound; see Attach.
|
||||
client.ForwardedPorts = ""
|
||||
if flow, ok := flowsByEmail[rec.Email]; ok && flow != "" {
|
||||
client.Flow = flow
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user