summaryrefslogtreecommitdiff
path: root/zebra/interface.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@nvidia.com>2022-01-25 13:49:05 -0500
committerStephen Worley <sworley@nvidia.com>2022-03-09 18:02:42 -0500
commit0dcd8506f2dac65bcac06f79a1660d809b329340 (patch)
tree29efc49d7c035f863e37459bf206c1960fef8b31 /zebra/interface.c
parent71ef5cbb9563e09a76996448a7f34cec37ed3c15 (diff)
zebra: clear protodown_rc on shutdown and sweep
Add functionality to clear any reason code set on shutdown of zebra when we are freeing the interface, in case a bad client didn't tell us to clear it when the shutdown. Also, in case of a crash or failure to do the above, clear reason on startup if it is set. Signed-off-by: Stephen Worley <sworley@nvidia.com>
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 23ff91faa3..15f8339c08 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -261,6 +261,12 @@ static int if_zebra_delete_hook(struct interface *ifp)
if (ifp->info) {
zebra_if = ifp->info;
+ /* If we set protodown, clear it now from the kernel */
+ if (ZEBRA_IF_IS_PROTODOWN(zebra_if) &&
+ !ZEBRA_IF_IS_PROTODOWN_ONLY_EXTERNAL(zebra_if))
+ zebra_if_set_protodown(ifp, false, ZEBRA_PROTODOWN_ALL);
+
+
/* Free installed address chains tree. */
if (zebra_if->ipv4_subnets)
route_table_finish(zebra_if->ipv4_subnets);