From 6a26737508d3ef7e52554c4d701ee92d452dd287 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Wed, 19 Oct 2022 10:20:13 +0800 Subject: [PATCH] Check destination before udp connect --- outbound/default.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/outbound/default.go b/outbound/default.go index 4b357f8a..c38aff3f 100644 --- a/outbound/default.go +++ b/outbound/default.go @@ -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 { switch metadata.Protocol { 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) var outConn net.PacketConn