diff options
-rw-r--r-- | server/peer.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/server/peer.go b/server/peer.go index 73aab7e6..3e264fbb 100644 --- a/server/peer.go +++ b/server/peer.go @@ -282,6 +282,13 @@ func (peer *Peer) loop() error { 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) { + pathList := peer.adjRib.GetOutPathList(peer.rf) + peer.sendMessages(table.CreateUpdateMsgFromPaths(pathList)) + peer.fsm.peerConfig.BgpNeighborCommonState.Uptime = time.Now() + peer.fsm.peerConfig.BgpNeighborCommonState.EstablishedCount++ + } + sameState := true for sameState { select { @@ -303,12 +310,6 @@ func (peer *Peer) loop() error { peer.peerConfig.BgpNeighborCommonState.State = uint32(nextState) peer.fsm.StateChange(nextState) sameState = false - if nextState == bgp.BGP_FSM_ESTABLISHED { - pathList := peer.adjRib.GetOutPathList(peer.rf) - peer.sendMessages(table.CreateUpdateMsgFromPaths(pathList)) - peer.fsm.peerConfig.BgpNeighborCommonState.Uptime = time.Now() - peer.fsm.peerConfig.BgpNeighborCommonState.EstablishedCount++ - } if oldState == bgp.BGP_FSM_ESTABLISHED { t := time.Now() peer.fsm.peerConfig.BgpNeighborCommonState.Downtime = t |