From 80c9a1bc12d90dee70411ce1f1995328a878ae46 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sun, 30 Dec 2018 16:48:34 +0000 Subject: [PATCH] Don't track localAddr in conns as it is irrelevant --- src/yggdrasil/tcp.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/yggdrasil/tcp.go b/src/yggdrasil/tcp.go index 224aca0f..4fb3026d 100644 --- a/src/yggdrasil/tcp.go +++ b/src/yggdrasil/tcp.go @@ -53,8 +53,8 @@ type tcpInterface struct { type tcpInfo struct { box crypto.BoxPubKey sig crypto.SigPubKey - localAddr string remoteAddr string + remotePort string } // Wrapper function to set additional options for specific connection types. @@ -313,8 +313,7 @@ func (iface *tcpInterface) handler(sock net.Conn, incoming bool) { } } // Check if we already have a connection to this node, close and block if yes - info.localAddr, _, _ = net.SplitHostPort(sock.LocalAddr().String()) - info.remoteAddr, _, _ = net.SplitHostPort(sock.RemoteAddr().String()) + info.remoteAddr, info.remotePort, _ = net.SplitHostPort(sock.RemoteAddr().String()) iface.mutex.Lock() if blockChan, isIn := iface.conns[info]; isIn { iface.mutex.Unlock()