ospf6_route_merge_nexthops(old, route);
if (is_debug)
- zlog_debug("%s: Update route: %s nh count %u",
- __PRETTY_FUNCTION__, buf,
+ zlog_debug("%s: Update route: %s old cost %u new cost %u nh count %u",
+ __PRETTY_FUNCTION__,
+ buf, old->path.cost, route->path.cost,
listcount(route->nh_list));
/* Update RIB/FIB */
ospf6_route_delete(route);
} else {
if (is_debug)
- zlog_debug("Install route: %s nh count %u", buf,
+ zlog_debug("%s: Install route: %s cost %u nh count %u",
+ __PRETTY_FUNCTION__, buf, route->path.cost,
listcount(route->nh_list));
/* ospf6_ia_add_nw_route (table, &prefix, route); */
ospf6_route_add(route, table);
brouter_id = ADV_ROUTER_IN_PREFIX(&brouter->prefix);
inet_ntop(AF_INET, &brouter_id, brouter_name,
sizeof(brouter_name));
+
if (brouter->path.area_id != oa->area_id)
continue;
+
SET_FLAG(brouter->flag, OSPF6_ROUTE_REMOVE);
if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER_ID(brouter_id)
if (brouter->type != OSPF6_DEST_TYPE_LINKSTATE)
continue;
+
if (ospf6_linkstate_prefix_id(&brouter->prefix) != htonl(0))
continue;
+
if (!CHECK_FLAG(brouter->path.router_bits, OSPF6_ROUTER_BIT_E)
&& !CHECK_FLAG(brouter->path.router_bits,
OSPF6_ROUTER_BIT_B))
if (CHECK_FLAG(brouter->flag, OSPF6_ROUTE_WAS_REMOVED))
continue;
+ /* After iterating spf_table for all routers including
+ * intra brouter, clear mark for remove flag for
+ * inter border router if its adv router present in
+ * SPF table.
+ */
+ if (brouter->path.type == OSPF6_PATH_TYPE_INTER) {
+ struct prefix adv_prefix;
+
+ ospf6_linkstate_prefix(brouter->path.origin.adv_router,
+ htonl(0), &adv_prefix);
+
+ if (ospf6_route_lookup(&adv_prefix, oa->spf_table)) {
+ if (IS_OSPF6_DEBUG_BROUTER) {
+ zlog_debug("%s: keep inter brouter %s as adv router 0x%x found in spf",
+ __PRETTY_FUNCTION__,
+ brouter_name,
+ brouter->path.origin.adv_router);
+ ospf6_brouter_debug_print(brouter);
+ }
+ UNSET_FLAG(brouter->flag, OSPF6_ROUTE_REMOVE);
+ }
+ }
+
if (CHECK_FLAG(brouter->flag, OSPF6_ROUTE_REMOVE)
&& CHECK_FLAG(brouter->flag, OSPF6_ROUTE_ADD)) {
UNSET_FLAG(brouter->flag, OSPF6_ROUTE_REMOVE);
UNSET_FLAG(brouter->flag, OSPF6_ROUTE_ADD);
+ zlog_debug("%s: EVENT unset REOUTE_REMOVE and ROUTE_ADD brouter %s",
+ __PRETTY_FUNCTION__, brouter_name);
+ ospf6_brouter_debug_print(brouter);
}
if (CHECK_FLAG(brouter->flag, OSPF6_ROUTE_REMOVE)) {
SET_FLAG(route->flag, OSPF6_ROUTE_BEST);
if (IS_OSPF6_DEBUG_ROUTE(MEMORY))
zlog_info(
- "%s %p: route add %p: replacing previous best: %p",
+ "%s %p: route add %p cost %u: replacing previous best: %p cost %u",
ospf6_route_table_name(table),
(void *)table, (void *)route,
- (void *)next);
+ route->path.cost,
+ (void *)next, next->path.cost);
}
route->installed = now;
/* Else, this is the brand new route regarding to the prefix */
if (IS_OSPF6_DEBUG_ROUTE(MEMORY))
- zlog_debug("%s %p: route add %p %s : brand new route",
+ zlog_debug("%s %p: route add %p %s cost %u: brand new route",
ospf6_route_table_name(table), (void *)table,
- (void *)route, buf);
+ (void *)route, buf, route->path.cost);
else if (IS_OSPF6_DEBUG_ROUTE(TABLE))
zlog_debug("%s: route add: brand new route",
ospf6_route_table_name(table));