Skip to content

Commit cbcaa0f

Browse files
Skyximnekohasekai
authored andcommitted
Check destination before udp connect
1 parent 763b93c commit cbcaa0f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

outbound/default.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ func NewEarlyConnection(ctx context.Context, this N.Dialer, conn net.Conn, metad
7979
func NewPacketConnection(ctx context.Context, this N.Dialer, conn N.PacketConn, metadata adapter.InboundContext) error {
8080
switch metadata.Protocol {
8181
case C.ProtocolQUIC, C.ProtocolDNS:
82-
return connectPacketConnection(ctx, this, conn, metadata)
82+
if !metadata.Destination.Addr.IsUnspecified() {
83+
return connectPacketConnection(ctx, this, conn, metadata)
84+
}
8385
}
8486
ctx = adapter.WithContext(ctx, &metadata)
8587
var outConn net.PacketConn

0 commit comments

Comments
 (0)