mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-13 05:44:12 +08:00
Revert "Fix listen packet on address"
This reverts commit d1fe17a4db1e444485fede62499135d95ce8c661.
This commit is contained in:
parent
51ce672076
commit
7a02cb83a7
@ -175,13 +175,9 @@ func (d *DefaultDialer) DialContext(ctx context.Context, network string, address
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *DefaultDialer) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error) {
|
func (d *DefaultDialer) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error) {
|
||||||
var destinationString string
|
if !destination.IsIPv6() {
|
||||||
if destination.IsValid() && !destination.Addr.IsUnspecified() {
|
return d.udpListener.ListenPacket(ctx, N.NetworkUDP, d.udpAddr4)
|
||||||
destinationString = destination.String()
|
|
||||||
} else if !destination.IsIPv6() {
|
|
||||||
destinationString = d.udpAddr4
|
|
||||||
} else {
|
} else {
|
||||||
destinationString = d.udpAddr6
|
return d.udpListener.ListenPacket(ctx, N.NetworkUDP, d.udpAddr6)
|
||||||
}
|
}
|
||||||
return d.udpListener.ListenPacket(ctx, N.NetworkUDP, destinationString)
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user