From fa84d4783caa94823e613bc63489a29216df4538 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Mon, 8 Feb 2016 05:14:12 -0800 Subject: server: fix socket md5 fix the regression due to c9436bc Signed-off-by: FUJITA Tomonori --- server/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server/server.go') diff --git a/server/server.go b/server/server.go index 4dfb2ba2..f98d4f4c 100644 --- a/server/server.go +++ b/server/server.go @@ -174,7 +174,8 @@ func (server *BgpServer) Listeners(addr string) []*net.TCPListener { list := make([]*net.TCPListener, 0, len(server.listeners)) rhs := net.ParseIP(addr).To4() != nil for _, l := range server.listeners { - lhs := net.ParseIP(l.Addr().String()).To4() != nil + host, _, _ := net.SplitHostPort(l.Addr().String()) + lhs := net.ParseIP(host).To4() != nil if lhs == rhs { list = append(list, l) } -- cgit v1.2.3