]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: Check active on OLD system/kernel routes
authorStephen Worley <sworley@cumulusnetworks.com>
Thu, 17 Oct 2019 19:41:25 +0000 (15:41 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 18 Oct 2019 20:59:34 +0000 (16:59 -0400)
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>
zebra/zebra_nhg.c

index 35df02a19ab469df002e6d66ad0d39625a03bbea..4e696b39ac14e1600e575352681aa48fc564e6dc 100644 (file)
@@ -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;
 
        /*