diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-16 16:34:38 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-16 16:34:38 +0900 |
commit | 7e1c219ea1640884de6a7548ce2da878e276d78e (patch) | |
tree | 2c707d79fb07cc4a5b2691aa613dce0fd14ae040 | |
parent | 3dc69c99b0dcbaa221ae3fd011af8bbb9f04a1d4 (diff) |
server: send proper notification when the config is deleted
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | bgpd.go | 2 | ||||
-rw-r--r-- | server/peer.go | 3 |
2 files changed, 3 insertions, 2 deletions
@@ -157,7 +157,7 @@ func main() { added = newConfig.NeighborList deleted = []config.NeighborType{} } else { - _, added, deleted = config.UpdateConfig(bgpConfig, &newConfig) + bgpConfig, added, deleted = config.UpdateConfig(bgpConfig, &newConfig) } for _, p := range added { diff --git a/server/peer.go b/server/peer.go index 6f0d2f6b..437ea38c 100644 --- a/server/peer.go +++ b/server/peer.go @@ -259,7 +259,8 @@ func (peer *Peer) loop() error { select { case <-peer.t.Dying(): close(peer.acceptedConnCh) - h.Stop() + h.fsm.outgoing <- bgp.NewBGPNotificationMessage(bgp.BGP_ERROR_CEASE, bgp.BGP_ERROR_SUB_PEER_DECONFIGURED, nil) + h.Wait() close(peer.incoming) close(peer.outgoing) return nil |