From 314a4b30152ea3d57a82019259fa56759bfef7b1 Mon Sep 17 00:00:00 2001 From: tsosunchia <59512455+tsosunchia@users.noreply.github.com> Date: Mon, 14 Apr 2025 22:46:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3udp=20mode=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E7=9A=84=E6=98=BE=E7=A4=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trace/udp.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/trace/udp.go b/trace/udp.go index 21edcb8..f1e0b09 100644 --- a/trace/udp.go +++ b/trace/udp.go @@ -137,7 +137,6 @@ func (t *UDPTracer) handleICMPMessage(msg ReceivedMessage, data []byte) { } var cachedLocalPort int -var localPortOnce sync.Once func (t *UDPTracer) getUDPConn(try int) (net.IP, int, net.PacketConn, error) { srcIP, _ := util.LocalIPPort(t.DestIP) @@ -273,7 +272,7 @@ func (t *UDPTracer) send(ttl int) error { } hopCh <- Hop{ Success: true, - Address: peer, + Address: &net.IPAddr{IP: peer.(*net.UDPAddr).IP}, } }() @@ -285,7 +284,6 @@ func (t *UDPTracer) send(ttl int) error { if t.final != -1 && ttl > t.final { return nil } - if addr, ok := h.Address.(*net.IPAddr); ok && addr.IP.Equal(t.DestIP) { t.finalLock.Lock() if t.final == -1 || ttl < t.final {