summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-22 16:44:02 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-22 16:44:02 +0900
commit94ed82255d6d7cc9d5c7aee9f9c71837bfd2e907 (patch)
tree0a765b0e15efe0a3cb186ac106fad4fb84e48358
parent355e5790dfd4a5941cd5c93586473819cc7e3bbd (diff)
peer: fix commit a9e55d3bd75fd5dd633fee1ff2c9d45d6d6447ee reggression
After became 'establish' state, we have to send update messages to the outstanding channel in _NEW_ fsm. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--server/peer.go13
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