mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-14 08:58:47 +00:00
Realm finalmask: Fix client punch peers (#6213)
Fixes https://github.com/XTLS/Xray-core/pull/6137
This commit is contained in:
@@ -167,7 +167,9 @@ func expandSymmetricNATCandidates(candidates []netip.AddrPort, seen map[netip.Ad
|
||||
added++
|
||||
}
|
||||
}
|
||||
sortAddrPorts(candidates)
|
||||
slices.SortFunc(candidates, func(a, b netip.AddrPort) int {
|
||||
return strings.Compare(a.String(), b.String())
|
||||
})
|
||||
return candidates
|
||||
}
|
||||
|
||||
@@ -197,12 +199,6 @@ func predictablePortGroup(ports []uint16) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func sortAddrPorts(addrs []netip.AddrPort) {
|
||||
slices.SortFunc(addrs, func(a, b netip.AddrPort) int {
|
||||
return strings.Compare(a.String(), b.String())
|
||||
})
|
||||
}
|
||||
|
||||
func addrPortStrings(addrs []netip.AddrPort) []string {
|
||||
out := make([]string, 0, len(addrs))
|
||||
for _, addr := range addrs {
|
||||
|
||||
Reference in New Issue
Block a user