summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaroslav Kholod <y.kholod@vyos.io>2024-12-23 13:06:57 +0200
committerYaroslav Kholod <y.kholod@vyos.io>2025-01-02 13:15:45 +0200
commita05c6af88f3d3085b2d0500021d5080dcc4bf9bb (patch)
tree27eed17348a150d728d114f4b14e4b920367374a
parent61ba8b91e52dd1c57cee072e8525165fe21251ed (diff)
babel: Clean babel related config on daemon stop
When deactivating babel no router babel and later re-enabling it router babel the previous configuration is still in place. Steps to reproduce: Enable babel Configure babel Disable babel with "no router babel" Verify config Expected correct behavior: No config present Signed-off-by: Yaroslav Kholod <y.kholod@vyos.io>
-rw-r--r--babeld/babel_interface.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index b83c7b1908..f17842366a 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -719,6 +719,7 @@ babel_interface_close_all(void)
{
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp = NULL;
+ int type;
FOR_ALL_INTERFACES(vrf, ifp) {
if(!if_up(ifp))
@@ -740,8 +741,14 @@ babel_interface_close_all(void)
flushbuf(ifp);
usleep(roughly(10000));
gettime(&babel_now);
+ babel_enable_if_delete(ifp->name);
interface_reset(ifp);
}
+ /* Disable babel redistribution */
+ for (type = 0; type < ZEBRA_ROUTE_MAX; type++) {
+ zclient_redistribute (ZEBRA_REDISTRIBUTE_DELETE, zclient, AFI_IP, type, 0, VRF_DEFAULT);
+ zclient_redistribute (ZEBRA_REDISTRIBUTE_DELETE, zclient, AFI_IP6, type, 0, VRF_DEFAULT);
+ }
}
/* return "true" if address is one of our ipv6 addresses */