rib: Stop removed namespace from inheriting ancestor route
refs: #2757
Change-Id: I9f9e18109f0d8ee45571d23a6eea7f254302a56f
diff --git a/rib/fib-updater.cpp b/rib/fib-updater.cpp
index 839e5ea..8d581be 100644
--- a/rib/fib-updater.cpp
+++ b/rib/fib-updater.cpp
@@ -612,7 +612,8 @@
// Need to check if the removed route was blocking an inherited route
Rib::RouteSet ancestorRoutes = m_rib.getAncestorRoutes(entry);
- if (!entry.hasCapture()) {
+ // If the current entry has capture set or is pending removal, don't add inherited route
+ if (!entry.hasCapture() && entry.getNRoutes() != 0) {
// If there is an ancestor route which is the same as the erased route, add that route
// to the current entry
Rib::RouteSet::iterator it = ancestorRoutes.find(route);