summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2021-06-22 10:45:53 +0200
committerLouis Scalbert <louis.scalbert@6wind.com>2021-07-01 14:40:14 +0200
commitc295917b4aadfde98692e314fc6b0c9f6af021dd (patch)
tree202f2295aba0cce2f7cb6606e0030154a1191d62
parentc54fb080a054524dbcb0a03a73c2905c8558ddc9 (diff)
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 <louis.scalbert@6wind.com>
-rw-r--r--ospf6d/ospf6_asbr.c18
1 files changed, 10 insertions, 8 deletions
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)