summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-10-17 21:41:25 +0200
committerStephen Worley <sworley@cumulusnetworks.com>2019-10-18 22:59:34 +0200
commita8c427ee392f087b9430a2ea9f5e04948bf5b937 (patch)
treef10fbe452a50d310f371c8b261c385641d9cd29b
parentzebra: Handle rib updates as a thread event (diff)
downloadfrr-a8c427ee392f087b9430a2ea9f5e04948bf5b937.tar.xz
frr-a8c427ee392f087b9430a2ea9f5e04948bf5b937.zip
zebra: Check active on OLD system/kernel routes
We can assume that system/kernel routes are valid indeed if this is our first time procesing them. But since we don't get explicit deletion events for kernel routes anymore, we have to be prepared to process them if the nexthop becomes unreachable for instance. Therefore, if the route is not NEW, then don't assume its valid. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
-rw-r--r--zebra/zebra_nhg.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c
index 35df02a19..4e696b39a 100644
--- a/zebra/zebra_nhg.c
+++ b/zebra/zebra_nhg.c
@@ -177,10 +177,16 @@ static int nexthop_active(afi_t afi, struct route_entry *re,
re->nexthop_mtu = 0;
/*
- * If the kernel has sent us a route, then
+ * If the kernel has sent us a NEW route, then
* by golly gee whiz it's a good route.
+ *
+ * If its an already INSTALLED route we have already handled, then the
+ * kernel route's nexthop might have became unreachable
+ * and we have to handle that.
*/
- if (re->type == ZEBRA_ROUTE_KERNEL || re->type == ZEBRA_ROUTE_SYSTEM)
+ if (!CHECK_FLAG(re->status, ROUTE_ENTRY_INSTALLED)
+ && (re->type == ZEBRA_ROUTE_KERNEL
+ || re->type == ZEBRA_ROUTE_SYSTEM))
return 1;
/*