diff options
Diffstat (limited to 'ospf6d/ospf6_asbr.c')
| -rw-r--r-- | ospf6d/ospf6_asbr.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index ba355a347e..d7307fe375 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -2478,7 +2478,7 @@ void ospf6_asbr_init(void) install_element(OSPF6_NODE, &no_ospf6_redistribute_cmd); } -void ospf6_asbr_redistribute_reset(struct ospf6 *ospf6) +void ospf6_asbr_redistribute_disable(struct ospf6 *ospf6) { int type; struct ospf6_redist *red; @@ -2500,6 +2500,35 @@ void ospf6_asbr_redistribute_reset(struct ospf6 *ospf6) } } +void ospf6_asbr_redistribute_reset(struct ospf6 *ospf6) +{ + int type; + struct ospf6_redist *red; + char buf[RMAP_NAME_MAXLEN]; + + for (type = 0; type <= ZEBRA_ROUTE_MAX; type++) { + buf[0] = '\0'; + if (type == ZEBRA_ROUTE_OSPF6) + continue; + red = ospf6_redist_lookup(ospf6, type, 0); + if (!red) + continue; + + if (type == DEFAULT_ROUTE) { + ospf6_redistribute_default_set( + ospf6, ospf6->default_originate); + continue; + } + if (ROUTEMAP_NAME(red)) + strlcpy(buf, ROUTEMAP_NAME(red), sizeof(buf)); + + ospf6_asbr_redistribute_unset(ospf6, red, type); + if (buf[0]) + ospf6_asbr_routemap_set(red, buf); + ospf6_asbr_redistribute_set(ospf6, type); + } +} + void ospf6_asbr_terminate(void) { /* Cleanup route maps */ |
