From: Louis Scalbert Date: Tue, 22 Jun 2021 08:45:53 +0000 (+0200) Subject: ospf6d: harmonize ospf6_asbr_redistribute_disable and _reset X-Git-Tag: base_8.1~361^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F8795%2Fhead;p=mirror%2Ffrr.git ospf6d: harmonize ospf6_asbr_redistribute_disable and _reset Harmonize the code of functions ospf6_asbr_redistribute_disable and ospf6_asbr_redistribute_reset. Signed-off-by: Louis Scalbert --- diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index d7307fe375..c537816d3b 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -2483,21 +2483,23 @@ void ospf6_asbr_redistribute_disable(struct ospf6 *ospf6) int type; struct ospf6_redist *red; - for (type = 0; type < ZEBRA_ROUTE_MAX; type++) { + for (type = 0; type <= ZEBRA_ROUTE_MAX; type++) { + if (type == ZEBRA_ROUTE_OSPF6) + continue; red = ospf6_redist_lookup(ospf6, type, 0); if (!red) continue; - if (type == ZEBRA_ROUTE_OSPF6) + + if (type == DEFAULT_ROUTE) { + ospf6_asbr_routemap_unset(red); + ospf6_redist_del(ospf6, red, type); + ospf6_redistribute_default_set(ospf6, + DEFAULT_ORIGINATE_NONE); continue; + } ospf6_asbr_redistribute_unset(ospf6, red, type); ospf6_redist_del(ospf6, red, type); } - red = ospf6_redist_lookup(ospf6, DEFAULT_ROUTE, 0); - if (red) { - ospf6_asbr_routemap_unset(red); - ospf6_redist_del(ospf6, red, type); - ospf6_redistribute_default_set(ospf6, DEFAULT_ORIGINATE_NONE); - } } void ospf6_asbr_redistribute_reset(struct ospf6 *ospf6)