summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-01-21 14:03:06 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-26 01:37:17 +0900
commitb86ab0904e3a04fb64e3596f22c3ae3c4cf395f9 (patch)
tree74b1b8bdde00e701e64494287183f9b58df026a5
parent34465b3ac1c39e900e66398c7901f0be7fdfa9e9 (diff)
bgp: don't hold withdrawn routes in adj_rib_in
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/services/protocols/bgp/peer.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/ryu/services/protocols/bgp/peer.py b/ryu/services/protocols/bgp/peer.py
index 4dafb105..b4b4cdd4 100644
--- a/ryu/services/protocols/bgp/peer.py
+++ b/ryu/services/protocols/bgp/peer.py
@@ -1466,8 +1466,10 @@ class Peer(Source, Sink, NeighborConfListener, Activity):
received_route = ReceivedRoute(w_path, self, block)
nlri_str = w_nlri.formatted_nlri_str
- self._adj_rib_in[nlri_str] = received_route
- self._signal_bus.adj_rib_in_changed(self, received_route)
+
+ if nlri_str in self._adj_rib_in:
+ del self._adj_rib_in[nlri_str]
+ self._signal_bus.adj_rib_in_changed(self, received_route)
if not block:
# Update appropriate table with withdraws.
@@ -1622,8 +1624,10 @@ class Peer(Source, Sink, NeighborConfListener, Activity):
received_route = ReceivedRoute(w_path, self, block)
nlri_str = w_nlri.formatted_nlri_str
- self._adj_rib_in[nlri_str] = received_route
- self._signal_bus.adj_rib_in_changed(self, received_route)
+
+ if nlri_str in self._adj_rib_in:
+ del self._adj_rib_in[nlri_str]
+ self._signal_bus.adj_rib_in_changed(self, received_route)
if not block:
# Update appropriate table with withdraws.