diff options
author | Donald Sharp <sharpd@nvidia.com> | 2022-06-15 22:27:07 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2022-06-16 20:47:19 +0200 |
commit | 382858d01500cf8f2289db17c7b07639b1714848 (patch) | |
tree | bae9326189b8e497b901cd01c77b6afed99b0674 /zebra | |
parent | zebra: Document some data structures better (diff) | |
download | frr-382858d01500cf8f2289db17c7b07639b1714848.tar.xz frr-382858d01500cf8f2289db17c7b07639b1714848.zip |
zebra: Move where zebra marks a nhg as uninstalled in fib
Currently the code is marking the nhg as uninstalled but not
causing that to flood up to the dependent nhgs:
nhg 3 is a group of 1/2
1 -> interface A
2 -> interface B
Suppose A goes down, old code would mark nhg 1 as !VALID and !INSTALLED.
Suppose B then goes down, old code would mark nhg 2 as !VALID and !INSTALLED
But would not mark nhg 3 as !VALID and !INSTALLED (sort of assuming that
it would just be cleaned up by NHG refcounts ). I would prefer that
the code is pedantic about nhg 3 actually being removed from the system.
This code moves the setting of !INSTALLED into zebra_nhg.c where it
really belongs.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/interface.c | 7 | ||||
-rw-r--r-- | zebra/zebra_nhg.c | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 96e378444..93ffeb437 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -184,13 +184,6 @@ static int if_zebra_new_hook(struct interface *ifp) static void if_nhg_dependents_check_valid(struct nhg_hash_entry *nhe) { zebra_nhg_check_valid(nhe); - if (!CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_VALID)) { - /* If we're in shutdown, this interface event needs to clean - * up installed NHGs, so don't clear that flag directly. - */ - if (!zrouter.in_shutdown) - UNSET_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED); - } } static void if_down_nhg_dependents(const struct interface *ifp) diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 500f4b0f1..e27078d13 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -1055,6 +1055,12 @@ static void zebra_nhg_set_invalid(struct nhg_hash_entry *nhe) UNSET_FLAG(nhe->flags, NEXTHOP_GROUP_VALID); + /* If we're in shutdown, this interface event needs to clean + * up installed NHGs, so don't clear that flag directly. + */ + if (!zrouter.in_shutdown) + UNSET_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED); + /* Update validity of nexthops depending on it */ frr_each(nhg_connected_tree, &nhe->nhg_dependents, rb_node_dep) zebra_nhg_check_valid(rb_node_dep->nhe); |