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>
This commit is contained in:
Louis Scalbert 2021-06-22 10:45:53 +02:00
parent c54fb080a0
commit c295917b4a

View File

@ -2483,20 +2483,22 @@ 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)
continue;
ospf6_asbr_redistribute_unset(ospf6, red, type);
ospf6_redist_del(ospf6, red, type);
}
red = ospf6_redist_lookup(ospf6, DEFAULT_ROUTE, 0);
if (red) {
if (type == DEFAULT_ROUTE) {
ospf6_asbr_routemap_unset(red);
ospf6_redist_del(ospf6, red, type);
ospf6_redistribute_default_set(ospf6, DEFAULT_ORIGINATE_NONE);
ospf6_redistribute_default_set(ospf6,
DEFAULT_ORIGINATE_NONE);
continue;
}
ospf6_asbr_redistribute_unset(ospf6, red, type);
ospf6_redist_del(ospf6, red, type);
}
}