From 573216befbea3399f36e8b4358cd2e4365a0e0e1 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Thu, 27 Apr 2023 01:39:29 +0000 Subject: [PATCH] fix: tracker remote addr check --- tunnel/statistic/tracker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tunnel/statistic/tracker.go b/tunnel/statistic/tracker.go index c4feeddb..0eaf4820 100644 --- a/tunnel/statistic/tracker.go +++ b/tunnel/statistic/tracker.go @@ -112,7 +112,7 @@ func (tt *tcpTracker) Upstream() any { func NewTCPTracker(conn C.Conn, manager *Manager, metadata *C.Metadata, rule C.Rule, uploadTotal int64, downloadTotal int64, pushToManager bool) *tcpTracker { if conn != nil { - if tcpAddr, ok := conn.RemoteAddr().(*net.TCPAddr); ok { + if tcpAddr, ok := conn.RemoteAddr().(*net.TCPAddr); ok && tcpAddr.IP != nil { metadata.RemoteDst = tcpAddr.IP.String() } else { metadata.RemoteDst = conn.RemoteDestination()