summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-08 23:21:40 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-08 23:21:40 +0900
commit4142dda9988d69a9e6c3d3ac098442a9309f0c67 (patch)
tree57cc51832ea693566e74baaf7ad88bec98fd6126
parent2e1e29ffac134b89a50271cac7f57978bd782d93 (diff)
server: drop all paths in adj-in when peer is down
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--server/peer.go1
-rw-r--r--table/table_manager.go5
2 files changed, 6 insertions, 0 deletions
diff --git a/server/peer.go b/server/peer.go
index ee3b2311..ec3f3f10 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -265,6 +265,7 @@ func (peer *Peer) loop() error {
}
if oldState == bgp.BGP_FSM_ESTABLISHED {
peer.fsm.peerConfig.BgpNeighborCommonState.Uptime = time.Time{}
+ peer.adjRib.DropAllIn(peer.rf)
pm := &peerMsg{
msgType: PEER_MSG_PEER_DOWN,
msgData: peer.peerInfo,
diff --git a/table/table_manager.go b/table/table_manager.go
index 7112c0ca..1fb95f3f 100644
--- a/table/table_manager.go
+++ b/table/table_manager.go
@@ -281,6 +281,11 @@ func (adj *AdjRib) GetOutPathList(rf bgp.RouteFamily) []Path {
return adj.getPathList(adj.adjRibOut[rf])
}
+func (adj *AdjRib) DropAllIn(rf bgp.RouteFamily) {
+ // replace old one
+ adj.adjRibIn[rf] = make(map[string]*ReceivedRoute)
+}
+
type ReceivedRoute struct {
path Path
filtered bool