fix: tracker remote addr check
This commit is contained in:
parent
30f93debc4
commit
573216befb
1 changed files with 1 additions and 1 deletions
|
@ -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 {
|
func NewTCPTracker(conn C.Conn, manager *Manager, metadata *C.Metadata, rule C.Rule, uploadTotal int64, downloadTotal int64, pushToManager bool) *tcpTracker {
|
||||||
if conn != nil {
|
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()
|
metadata.RemoteDst = tcpAddr.IP.String()
|
||||||
} else {
|
} else {
|
||||||
metadata.RemoteDst = conn.RemoteDestination()
|
metadata.RemoteDst = conn.RemoteDestination()
|
||||||
|
|
Loading…
Reference in a new issue