]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Re-evaluate the nexthop tracking if flags changed
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 21 Feb 2019 21:10:56 +0000 (16:10 -0500)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Tue, 5 Nov 2019 18:11:03 +0000 (20:11 +0200)
Routing protocols are allowed ( and even encouraged ) to modify
the flags that influence the nexthop tracking.  As such when
we modify the tracking of a nexthop to go from, say, connected force
or not we must re-evaluate the nexthop and send the results
up to the interested parties.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
zebra/zapi_msg.c

index 1875fa52579fdccfa3fb5b69dfe2b17cf3d53c08..2cfd95456728e801e751d93aa2ff909d3b9e4eb4 100644 (file)
@@ -1039,6 +1039,8 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
        uint8_t flags = 0;
        uint16_t type = cmd2type[hdr->command];
        bool exist;
+       bool flag_changed = false;
+       uint8_t orig_flags;
 
        if (IS_ZEBRA_DEBUG_NHT)
                zlog_debug(
@@ -1087,6 +1089,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
                if (!rnh)
                        return;
 
+               orig_flags = rnh->flags;
                if (type == RNH_NEXTHOP_TYPE) {
                        if (flags
                            && !CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED))
@@ -1104,9 +1107,12 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
                                UNSET_FLAG(rnh->flags, ZEBRA_NHT_EXACT_MATCH);
                }
 
+               if (orig_flags != rnh->flags)
+                       flag_changed = true;
+
                zebra_add_rnh_client(rnh, client, type, zvrf_id(zvrf));
                /* Anything not AF_INET/INET6 has been filtered out above */
-               if (!exist)
+               if (!exist || flag_changed)
                        zebra_evaluate_rnh(zvrf, p.family, 1, type, &p);
        }