From b285fb2475ecf0543a1c3cbfbff1b195d12678d5 Mon Sep 17 00:00:00 2001 From: IWASE Yusuke Date: Tue, 5 Jun 2018 14:51:43 +0900 Subject: config: Accept CLUSTER_ID as an integer value Currently, only IPv4 address is acceptable for the CLUSTER_ID setting, this patch enables to specify the CLUSTER_ID as a 32-bit unsigned integer. With this expansion, "Config.RouteReflectorClusterId" stores the raw configured value for the CLUSTER_ID and "State.RouteReflectorClusterId" stores the value used for construct the CLUSTER_LIST attribute. Signed-off-by: IWASE Yusuke --- table/destination.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'table/destination.go') diff --git a/table/destination.go b/table/destination.go index a37d2114..bf375cd4 100644 --- a/table/destination.go +++ b/table/destination.go @@ -150,7 +150,7 @@ func (i *PeerInfo) String() string { } func NewPeerInfo(g *config.Global, p *config.Neighbor) *PeerInfo { - id := net.ParseIP(string(p.RouteReflector.Config.RouteReflectorClusterId)).To4() + clusterID := net.ParseIP(string(p.RouteReflector.State.RouteReflectorClusterId)).To4() // exclude zone info naddr, _ := net.ResolveIPAddr("ip", p.State.NeighborAddress) return &PeerInfo{ @@ -159,7 +159,7 @@ func NewPeerInfo(g *config.Global, p *config.Neighbor) *PeerInfo { LocalID: net.ParseIP(g.Config.RouterId).To4(), RouteReflectorClient: p.RouteReflector.Config.RouteReflectorClient, Address: naddr.IP, - RouteReflectorClusterID: id, + RouteReflectorClusterID: clusterID, MultihopTtl: p.EbgpMultihop.Config.MultihopTtl, Confederation: p.IsConfederationMember(g), } -- cgit v1.2.3