From 01b7e5e9be034421c948e59c64977aee16f67d1e Mon Sep 17 00:00:00 2001 From: RPRX <63339210+RPRX@users.noreply.github.com> Date: Wed, 12 Apr 2023 23:20:26 +0800 Subject: [PATCH] XUDP Global ID should be empty if "cone" is disabled (client side) --- common/xudp/xudp.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/xudp/xudp.go b/common/xudp/xudp.go index 32dda614..a162334a 100644 --- a/common/xudp/xudp.go +++ b/common/xudp/xudp.go @@ -47,6 +47,9 @@ func init() { } func GetGlobalID(ctx context.Context) (globalID [8]byte) { + if cone := ctx.Value("cone"); cone == nil || !cone.(bool) { // cone is nil only in some unit tests + return + } if inbound := session.InboundFromContext(ctx); inbound != nil && inbound.Source.Network == net.Network_UDP && (inbound.Name == "dokodemo-door" || inbound.Name == "socks" || inbound.Name == "shadowsocks") { h := blake3.New(8, BaseKey)