summaryrefslogtreecommitdiffhomepage
path: root/server/peer_test.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-03-08 15:13:07 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-03-08 15:13:07 +0900
commit1c982d8336c9d89732e8a481a8c90b3e7e283f6f (patch)
tree60c48bd57d3fb771ddab46a9e9e2b76b7715069b /server/peer_test.go
parent608d09c90e906ed43e9206e903443753f73d80b0 (diff)
server: support multiple route familes per peer
You can configure like the following: [Global] As = 65032 RouterId = "192.168.255.1" [[NeighborList]] NeighborAddress = "10.0.255.1" PeerAs = 65001 [NeighborList.RouteServer] RouteServerClient = true [[NeighborList.AfiSafiList]] AfiSafiName = "ipv4-unicast" [[NeighborList.AfiSafiList]] AfiSafiName = "ipv6-unicast" Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/peer_test.go')
-rw-r--r--server/peer_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/peer_test.go b/server/peer_test.go
index a637a18d..a4c60de7 100644
--- a/server/peer_test.go
+++ b/server/peer_test.go
@@ -505,6 +505,7 @@ func makePeer(globalConfig config.Global, peerConfig config.Neighbor) *Peer {
acceptedConnCh: make(chan net.Conn),
serverMsgCh: sch,
peerMsgCh: pch,
+ rfMap: make(map[bgp.RouteFamily]bool),
capMap: make(map[bgp.BGPCapabilityCode]bgp.ParameterCapabilityInterface),
}
p.siblings = make(map[string]*serverMsgDataPeer)
@@ -513,9 +514,9 @@ func makePeer(globalConfig config.Global, peerConfig config.Neighbor) *Peer {
peerConfig.BgpNeighborCommonState.State = uint32(bgp.BGP_FSM_IDLE)
peerConfig.BgpNeighborCommonState.Downtime = time.Now().Unix()
if peerConfig.NeighborAddress.To4() != nil {
- p.rf = bgp.RF_IPv4_UC
+ p.rfMap[bgp.RF_IPv4_UC] = true
} else {
- p.rf = bgp.RF_IPv6_UC
+ p.rfMap[bgp.RF_IPv6_UC] = true
}
p.peerInfo = &table.PeerInfo{