]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospf6d: harmonize ospf6_asbr_redistribute_disable and _reset
authorLouis Scalbert <louis.scalbert@6wind.com>
Tue, 22 Jun 2021 08:45:53 +0000 (10:45 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Thu, 1 Jul 2021 12:40:14 +0000 (14:40 +0200)
Harmonize the code of functions ospf6_asbr_redistribute_disable and
ospf6_asbr_redistribute_reset.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
ospf6d/ospf6_asbr.c

index d7307fe375943e408e39ef6421b909a08c5e3b8c..c537816d3b126a52215f23b9f5603fe1af99b149 100644 (file)
@@ -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)