summaryrefslogtreecommitdiffhomepage
path: root/table/destination.go
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2018-06-05 14:51:43 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-06-05 20:07:09 +0900
commitb285fb2475ecf0543a1c3cbfbff1b195d12678d5 (patch)
tree0b99e254e85a34bb5b742b72c2152db98ae45281 /table/destination.go
parentc78328019756dca6912b69d7ecfcb850f727513f (diff)
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 <iwase.yusuke0@gmail.com>
Diffstat (limited to 'table/destination.go')
-rw-r--r--table/destination.go4
1 files changed, 2 insertions, 2 deletions
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),
}