X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ospf6d%2Fospf6_abr.c;h=ff82bb179821ee391b02ef6ba3607792fbf7f922;hb=b0a89c27ad2e7f980d6bf9c78c6ff6a5cfe058c7;hp=1890e9bdc39aba25813a53467f337d4ceaf18df2;hpb=e2392415346356926538d0433cbfb1ddcc9a2de1;p=mirror_frr.git diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c index 1890e9bdc..ff82bb179 100644 --- a/ospf6d/ospf6_abr.c +++ b/ospf6d/ospf6_abr.c @@ -240,6 +240,20 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route, } } + if (route->path.origin.type == + htons(OSPF6_LSTYPE_INTRA_PREFIX)) { + if (!CHECK_FLAG(route->flag, OSPF6_ROUTE_BEST)) { + if (is_debug) { + prefix2str(&route->prefix, buf, + sizeof(buf)); + zlog_debug("%s: intra-prefix route %s with cost %u is not best, ignore." + , __PRETTY_FUNCTION__, buf, + route->path.cost); + } + return 0; + } + } + if (is_debug) { prefix2str(&route->prefix, buf, sizeof(buf)); zlog_debug("Originating summary in area %s for %s cost %u", @@ -271,9 +285,10 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route, ospf6_abr_delete_route(route, summary, summary_table, old); } - } else if (old) + } else if (old) { + ospf6_route_remove(summary, summary_table); ospf6_lsa_purge(old); - + } return 0; } @@ -321,7 +336,7 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route, /* if this is a route to ASBR */ if (route->type == OSPF6_DEST_TYPE_ROUTER) { - /* Only the prefered best path is considered */ + /* Only the preferred best path is considered */ if (!CHECK_FLAG(route->flag, OSPF6_ROUTE_BEST)) { if (is_debug) zlog_debug( @@ -1405,7 +1420,7 @@ void install_element_ospf6_debug_abr(void) install_element(CONFIG_NODE, &no_debug_ospf6_abr_cmd); } -struct ospf6_lsa_handler inter_prefix_handler = { +static const struct ospf6_lsa_handler inter_prefix_handler = { .lh_type = OSPF6_LSTYPE_INTER_PREFIX, .lh_name = "Inter-Prefix", .lh_short_name = "IAP", @@ -1413,7 +1428,7 @@ struct ospf6_lsa_handler inter_prefix_handler = { .lh_get_prefix_str = ospf6_inter_area_prefix_lsa_get_prefix_str, .lh_debug = 0}; -struct ospf6_lsa_handler inter_router_handler = { +static const struct ospf6_lsa_handler inter_router_handler = { .lh_type = OSPF6_LSTYPE_INTER_ROUTER, .lh_name = "Inter-Router", .lh_short_name = "IAR",