diff options
Diffstat (limited to 'server/server.go')
-rw-r--r-- | server/server.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server/server.go b/server/server.go index 73ac5ad1..b9c6351d 100644 --- a/server/server.go +++ b/server/server.go @@ -260,7 +260,9 @@ func (server *BgpServer) Serve() { } passConn := func(conn *net.TCPConn) { - remoteAddr, _, _ := net.SplitHostPort(conn.RemoteAddr().String()) + host, _, _ := net.SplitHostPort(conn.RemoteAddr().String()) + ipaddr, _ := net.ResolveIPAddr("ip", host) + remoteAddr := ipaddr.IP.String() peer, found := server.neighborMap[remoteAddr] if found { if peer.fsm.adminState != ADMIN_STATE_UP { |