]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: A group isn't recursive if one depend is
authorStephen Worley <sworley@cumulusnetworks.com>
Thu, 25 Jul 2019 17:18:27 +0000 (13:18 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 25 Oct 2019 15:13:41 +0000 (11:13 -0400)
We were setting a group to be recursive if its first depend
was. This is not the case; individual depends of the group
might be recursive but the group itself is not.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
zebra/zebra_nhg.c

index 5179533e750cb049a6310d4615d1a609f4a89488..a02df6b168c72053e4d2a4fa02dfaaf8360be263 100644 (file)
@@ -720,6 +720,7 @@ zebra_nhg_rib_find(uint32_t id, struct nexthop_group *nhg, afi_t rt_afi)
 {
        struct nhg_hash_entry *nhe = NULL;
        struct nhg_connected_tree_head nhg_depends = {};
+       bool recursive = false;
 
        /* Defualt the nhe to the afi and vrf of the route */
        afi_t nhg_afi = rt_afi;
@@ -747,12 +748,13 @@ zebra_nhg_rib_find(uint32_t id, struct nexthop_group *nhg, afi_t rt_afi)
                nhg_connected_tree_init(&nhg_depends);
                handle_recursive_depend(&nhg_depends, nhg->nexthop->resolved,
                                        rt_afi);
+               recursive = true;
        }
 
        if (!zebra_nhg_find(&nhe, id, nhg, &nhg_depends, nhg_vrf_id, nhg_afi,
                            false))
                depends_decrement_free(&nhg_depends);
-       else if (CHECK_FLAG(nhg->nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
+       else if (recursive)
                SET_FLAG(nhe->flags, NEXTHOP_GROUP_RECURSIVE);
 
        return nhe;