From 029852207a0318056edd984ae876f85eefd1df1f Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Tue, 2 Aug 2016 10:19:26 +0000 Subject: server: fix bug of wrongly set to PeerInfo.LocalAddress config.TransportState.LocalAddress may have zone info with ipv6 address like "fe80::x%eth0". In this case, net.ParseIP() returns , which leads to set to PeerInfo.LocalAddress. Signed-off-by: ISHIDA Wataru --- table/destination.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'table/destination.go') diff --git a/table/destination.go b/table/destination.go index dbcbddb1..50d779df 100644 --- a/table/destination.go +++ b/table/destination.go @@ -108,12 +108,14 @@ func (i *PeerInfo) String() string { func NewPeerInfo(g *config.Global, p *config.Neighbor) *PeerInfo { id := net.ParseIP(string(p.RouteReflector.Config.RouteReflectorClusterId)).To4() + // exclude zone info + naddr, _ := net.ResolveIPAddr("ip", p.Config.NeighborAddress) return &PeerInfo{ AS: p.Config.PeerAs, LocalAS: g.Config.As, LocalID: net.ParseIP(g.Config.RouterId).To4(), - Address: net.ParseIP(p.Config.NeighborAddress), RouteReflectorClient: p.RouteReflector.Config.RouteReflectorClient, + Address: naddr.IP, RouteReflectorClusterID: id, MultihopTtl: p.EbgpMultihop.Config.MultihopTtl, } -- cgit v1.2.3