summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/server.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@gmail.com>2019-03-24 22:16:12 +0900
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2019-03-24 22:16:12 +0900
commit04843ab5032cb6f8edebf1226acc9ba78c5ff1e2 (patch)
treee57a0267a307015824a40c99cb1f0318518fd2ca /pkg/server/server.go
parentc86c924bb3e93bda7dbdfa3d338de0fa47f8cbf6 (diff)
server: broadcast BMPPeerDownMessage for peer deletion
Sends peerdown message when a peer is de-condigured and down. Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Diffstat (limited to 'pkg/server/server.go')
-rw-r--r--pkg/server/server.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/server/server.go b/pkg/server/server.go
index cdc557b5..9871d4ac 100644
--- a/pkg/server/server.go
+++ b/pkg/server/server.go
@@ -337,6 +337,19 @@ func (s *BgpServer) Serve() {
"State": state,
}).Debug("freed fsm.h")
+ if fsm.state == bgp.BGP_FSM_ESTABLISHED {
+ s.notifyWatcher(watchEventTypePeerState, &watchEventPeerState{
+ PeerAS: fsm.peerInfo.AS,
+ PeerAddress: fsm.peerInfo.Address,
+ PeerID: fsm.peerInfo.ID,
+ State: bgp.BGP_FSM_IDLE,
+ Timestamp: time.Now(),
+ StateReason: &fsmStateReason{
+ Type: fsmDeConfigured,
+ },
+ })
+ }
+
cleanInfiniteChannel(fsm.outgoingCh)
cleanInfiniteChannel(fsm.incomingCh)
s.delIncoming(fsm.incomingCh)