summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-03-21 08:45:11 +0000
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-03-25 18:17:13 +0900
commit2bf0f90ba82c779121571466eb7c41a4176cf176 (patch)
tree9516c574a4d11ee321976a6243238e1cb23a4748
parent22bc21ebea87b381838477e070ae4cb70e263d66 (diff)
server: don't run fsm for global rib
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r--server/peer.go22
1 files changed, 13 insertions, 9 deletions
diff --git a/server/peer.go b/server/peer.go
index 107a39fb..14b3548d 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -562,16 +562,20 @@ func (peer *Peer) loop() error {
incoming := make(chan *fsmMsg, FSM_CHANNEL_LENGTH)
peer.outgoing = make(chan *bgp.BGPMessage, FSM_CHANNEL_LENGTH)
- h := NewFSMHandler(peer.fsm, incoming, peer.outgoing)
- if peer.peerConfig.BgpNeighborCommonState.State == uint32(bgp.BGP_FSM_ESTABLISHED) {
- for rf, _ := range peer.rfMap {
- pathList := peer.adjRib.GetOutPathList(rf)
- peer.sendMessages(table.CreateUpdateMsgFromPaths(pathList))
+ var h *FSMHandler
+
+ if !peer.isGlobalRib {
+ h = NewFSMHandler(peer.fsm, incoming, peer.outgoing)
+ if peer.peerConfig.BgpNeighborCommonState.State == uint32(bgp.BGP_FSM_ESTABLISHED) {
+ for rf, _ := range peer.rfMap {
+ pathList := peer.adjRib.GetOutPathList(rf)
+ peer.sendMessages(table.CreateUpdateMsgFromPaths(pathList))
+ }
+ peer.fsm.peerConfig.BgpNeighborCommonState.Uptime = time.Now().Unix()
+ peer.fsm.peerConfig.BgpNeighborCommonState.EstablishedCount++
+ } else {
+ peer.fsm.peerConfig.BgpNeighborCommonState.Downtime = time.Now().Unix()
}
- peer.fsm.peerConfig.BgpNeighborCommonState.Uptime = time.Now().Unix()
- peer.fsm.peerConfig.BgpNeighborCommonState.EstablishedCount++
- } else {
- peer.fsm.peerConfig.BgpNeighborCommonState.Downtime = time.Now().Unix()
}
sameState := true