From 0864ddc6a7bec45295076967388949c7af9db1ac Mon Sep 17 00:00:00 2001 From: W192547975 <138874985+W192547975@users.noreply.github.com> Date: Thu, 3 Aug 2023 21:34:57 +0800 Subject: [PATCH] Update nat.go publicIPTest --- core/nat.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/nat.go b/core/nat.go index d757a59..debe3dc 100644 --- a/core/nat.go +++ b/core/nat.go @@ -175,11 +175,10 @@ func publicIPTest(publicIP string, echoPort int) (hasPublicIP int, hasUPNPorNATP break } conn.WriteTo([]byte("echo"), dst) - buf := make([]byte, 1600) // wait for echo testing conn.SetReadDeadline(time.Now().Add(PublicIPEchoTimeout)) - _, _, err = conn.ReadFromUDP(buf) + _, _, err = conn.ReadFromUDP(make([]byte, 1600)) if err == nil { if i == 1 { gLog.Println(LvDEBUG, "UPNP or NAT-PMP:YES")