diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-04-27 15:10:24 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-04-27 16:17:41 +0900 |
commit | 163ac0c327dd96e186ea30d6c15c12178996f757 (patch) | |
tree | f0357ecef6e63c01bf0e4c19fe40f71fd0e0dcc8 | |
parent | 738c350a6703e02e73992dd49ef0134cea22df0f (diff) |
server: fix handling bgp messages right after moving to idle state from established
currently gobgpd continues to handle update messages even if
becomedidle state from establised.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | server/server.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/server/server.go b/server/server.go index ed245ff8..8ced6147 100644 --- a/server/server.go +++ b/server/server.go @@ -840,6 +840,9 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *FsmMsg) { peer.startFSMHandler(server.fsmincomingCh, server.fsmStateCh) server.broadcastPeerState(peer, oldState) case FSM_MSG_ROUTE_REFRESH: + if peer.fsm.state != bgp.BGP_FSM_ESTABLISHED || e.timestamp.Unix() < peer.fsm.pConf.Timers.State.Uptime { + return + } if paths := peer.handleRouteRefresh(e); len(paths) > 0 { sendFsmOutgoingMsg(peer, paths, nil, false) return @@ -850,6 +853,9 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *FsmMsg) { sendFsmOutgoingMsg(peer, nil, bgp.NewBGPNotificationMessage(m.TypeCode, m.SubTypeCode, m.Data), false) return case *bgp.BGPMessage: + if peer.fsm.state != bgp.BGP_FSM_ESTABLISHED || e.timestamp.Unix() < peer.fsm.pConf.Timers.State.Uptime { + return + } server.roaManager.validate(e.PathList) pathList, eor, notification := peer.handleUpdate(e) if notification != nil { |