From: Manoj Naragund Date: Tue, 25 Oct 2022 08:08:43 +0000 (-0700) Subject: ospf6d: ospf6 route installation when changed from nssa to regular area. X-Git-Tag: base_8.5~150^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=27c233568527a30da219c034b5eb0eb2539cfb43;p=mirror%2Ffrr.git ospf6d: ospf6 route installation when changed from nssa to regular area. Problem: Delay in ospfv3 route installation when area gets converted to regular from NSSA. RCA: when area gets converted from NSSA to normal the type-7(NSSA_LSAs) gets flushed from the area, as a result the external routes learnt from these type-7s gets removed. Once the area is moved to nomral the type 5 lsas needs to flooded through the area so that routes are re-learnt. however there is a delay in flooding of these routes until these routes are refreshed. Due to this there is delay installation of these routes. Fix: The Fix involves refreshing of the type 5 lsas once the area is changed from nssa to regular area. Signed-off-by: Manoj Naragund --- diff --git a/ospf6d/ospf6_nssa.c b/ospf6d/ospf6_nssa.c index b1bff69f06..569e536e36 100644 --- a/ospf6d/ospf6_nssa.c +++ b/ospf6d/ospf6_nssa.c @@ -1092,7 +1092,25 @@ static void ospf6_check_and_originate_type7_lsa(struct ospf6_area *area) ospf6_nssa_lsa_originate(aggr->route, area, true); } } +} + +static void ospf6_ase_lsa_refresh(struct ospf6 *o) +{ + struct ospf6_lsa *old; + for (struct ospf6_route *route = ospf6_route_head(o->external_table); + route; route = ospf6_route_next(route)) { + old = ospf6_lsdb_lookup(htons(OSPF6_LSTYPE_AS_EXTERNAL), + route->path.origin.id, o->router_id, + o->lsdb); + if (old) { + THREAD_OFF(old->refresh); + thread_add_event(master, ospf6_lsa_refresh, old, 0, + &old->refresh); + } else { + ospf6_as_external_lsa_originate(route, o); + } + } } void ospf6_area_nssa_update(struct ospf6_area *area) @@ -1136,6 +1154,36 @@ void ospf6_area_nssa_update(struct ospf6_area *area) if (IS_OSPF6_DEBUG_NSSA) zlog_debug("Normal area %s", area->name); ospf6_nssa_flush_area(area); + + /* Check if router is ABR */ + if (ospf6_check_and_set_router_abr(area->ospf6)) { + if (IS_OSPF6_DEBUG_NSSA) + zlog_debug("Router is ABR area %s", area->name); + ospf6_schedule_abr_task(area->ospf6); + ospf6_ase_lsa_refresh(area->ospf6); + } else { + uint16_t type; + struct ospf6_lsa *lsa = NULL; + + /* + * Refresh all type-5 LSAs so they get installed + * in the converted ares + */ + if (IS_OSPF6_DEBUG_NSSA) + zlog_debug("Refresh type-5 LSAs, area %s", + area->name); + + type = htons(OSPF6_LSTYPE_AS_EXTERNAL); + for (ALL_LSDB_TYPED_ADVRTR(area->ospf6->lsdb, type, + area->ospf6->router_id, + lsa)) { + if (IS_OSPF6_DEBUG_NSSA) + ospf6_lsa_header_print(lsa); + THREAD_OFF(lsa->refresh); + thread_add_event(master, ospf6_lsa_refresh, lsa, + 0, &lsa->refresh); + } + } } }