mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-01-23 01:06:38 +00:00
Check destination before udp connect
This commit is contained in:
parent
92a92f39c5
commit
6a26737508
|
@ -79,7 +79,9 @@ func NewEarlyConnection(ctx context.Context, this N.Dialer, conn net.Conn, metad
|
||||||
func NewPacketConnection(ctx context.Context, this N.Dialer, conn N.PacketConn, metadata adapter.InboundContext) error {
|
func NewPacketConnection(ctx context.Context, this N.Dialer, conn N.PacketConn, metadata adapter.InboundContext) error {
|
||||||
switch metadata.Protocol {
|
switch metadata.Protocol {
|
||||||
case C.ProtocolQUIC, C.ProtocolDNS:
|
case C.ProtocolQUIC, C.ProtocolDNS:
|
||||||
return connectPacketConnection(ctx, this, conn, metadata)
|
if !metadata.Destination.Addr.IsUnspecified() {
|
||||||
|
return connectPacketConnection(ctx, this, conn, metadata)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ctx = adapter.WithContext(ctx, &metadata)
|
ctx = adapter.WithContext(ctx, &metadata)
|
||||||
var outConn net.PacketConn
|
var outConn net.PacketConn
|
||||||
|
|
Loading…
Reference in a new issue