]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6d: Remove Type-7 LSA when Type-5 LSA is removed 9342/head
authorMobashshera Rasool <mrasool@vmware.com>
Mon, 9 Aug 2021 11:57:11 +0000 (04:57 -0700)
committerMobashshera Rasool <mrasool@vmware.com>
Mon, 9 Aug 2021 16:11:10 +0000 (09:11 -0700)
Fix:
When summarised Type-5 LSA is removed, the corresponding Type-7
LSAs also need to be removed from area.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
ospf6d/ospf6_asbr.c
ospf6d/ospf6_flood.c

index 0762425a1fea03ba2784d9b1845bdfecfa755df1..2d70f816eca95120a6e8fe54d6db9fba3609b88c 100644 (file)
@@ -1514,8 +1514,6 @@ static void ospf6_asbr_external_lsa_remove_by_id(struct ospf6 *ospf6,
                                         uint32_t id)
 {
        struct ospf6_lsa *lsa;
-       struct ospf6_area *oa;
-       struct listnode *lnode;
 
        lsa = ospf6_lsdb_lookup(htons(OSPF6_LSTYPE_AS_EXTERNAL),
                                htonl(id), ospf6->router_id, ospf6->lsdb);
@@ -1524,20 +1522,6 @@ static void ospf6_asbr_external_lsa_remove_by_id(struct ospf6 *ospf6,
 
        ospf6_external_lsa_purge(ospf6, lsa);
 
-       /* Delete the NSSA LSA */
-       for (ALL_LIST_ELEMENTS_RO(ospf6->area_list, lnode, oa)) {
-               lsa = ospf6_lsdb_lookup(htons(OSPF6_LSTYPE_TYPE_7),
-                                       htonl(id), ospf6->router_id,
-                                       oa->lsdb);
-               if (lsa) {
-                       if (IS_OSPF6_DEBUG_ASBR)
-                               zlog_debug("withdraw type 7 lsa, LS ID: %u",
-                                          htonl(id));
-
-                       ospf6_lsa_purge(lsa);
-               }
-       }
-
 }
 
 static void
index 3d52597161766aae744af26ecc132ba199231b0e..5a4dd72b66249f682d78fa49d6c7d429086a0688 100644 (file)
@@ -169,9 +169,26 @@ void ospf6_remove_id_from_external_id_table(struct ospf6 *ospf6,
 
 void ospf6_external_lsa_purge(struct ospf6 *ospf6, struct ospf6_lsa *lsa)
 {
+       uint32_t id = lsa->header->id;
+       struct ospf6_area *oa;
+       struct listnode *lnode;
+
        ospf6_lsa_purge(lsa);
 
-       ospf6_remove_id_from_external_id_table(ospf6, lsa->header->id);
+       ospf6_remove_id_from_external_id_table(ospf6, id);
+
+       /* Delete the corresponding NSSA LSA */
+       for (ALL_LIST_ELEMENTS_RO(ospf6->area_list, lnode, oa)) {
+               lsa = ospf6_lsdb_lookup(htons(OSPF6_LSTYPE_TYPE_7), id,
+                                       ospf6->router_id, oa->lsdb);
+               if (lsa) {
+                       if (IS_OSPF6_DEBUG_NSSA)
+                               zlog_debug("withdraw type 7 lsa, LS ID: %u",
+                                          htonl(id));
+
+                       ospf6_lsa_purge(lsa);
+               }
+       }
 }
 
 void ospf6_lsa_purge(struct ospf6_lsa *lsa)