From 9d29c4f43daa3d64bffdc9026c87c5bff2c758c4 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 9 Apr 2018 19:53:52 -0700 Subject: [PATCH] server: only swap out the port for inbound connections Note that the check is actually reversed to the quirk atm in the server logic, where inbound and outbound are reversed. Fixes #1063. --- server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.go b/server.go index c4f5cea15..ed6f7531d 100644 --- a/server.go +++ b/server.go @@ -1368,7 +1368,7 @@ func (s *server) peerConnected(conn net.Conn, connReq *connmgr.ConnReq, // We'll ensure that we locate the proper port to use within the peer's // address for reconnecting purposes. - if tcpAddr, ok := addr.(*net.TCPAddr); ok { + if tcpAddr, ok := addr.(*net.TCPAddr); ok && !inbound { targetPort := s.fetchNodeAdvertisedPort(pubKey, tcpAddr) // Once we have the correct port, we'll make a new copy of the