]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6d: ospf6 route installation when changed from nssa to regular area.
authorManoj Naragund <mnaragund@vmware.com>
Tue, 25 Oct 2022 08:08:43 +0000 (01:08 -0700)
committerManoj Naragund <mnaragund@vmware.com>
Mon, 14 Nov 2022 12:47:08 +0000 (04:47 -0800)
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 <mnaragund@vmware.com>
ospf6d/ospf6_nssa.c

index b1bff69f06d15290328c97849f6f663a23dac619..569e536e368818e0f4ccb2acfe5ec95e8ad93ae0 100644 (file)
@@ -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);
+                       }
+               }
        }
 }