]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospf6d: Max aged LSAs are not getting deleted from DB
authorMobashshera Rasool <mrasool@vmware.com>
Thu, 24 Jun 2021 11:10:04 +0000 (11:10 +0000)
committermergify-bot <noreply@mergify.io>
Thu, 22 Jul 2021 16:33:22 +0000 (16:33 +0000)
Problem Statement:
==================
Max aged LSAs are not getting deleted from DB when there are multiple
neighbors in a LAN.

Root Cause Analysis:
====================
When the LSA is added to the neighbor's retransmit list, the LSA retrans count
is incremented but it is not checked if the LSA is already present in the
retransmit list leading to the count being incremented multiple times
untill the ack is not received and when the ack is received the count is
decremented once and hence the count never becomes 0 and
it remains in the DB forever.

Fix:
====================
Do not increment the retrans count multiple times if the LSA is already
present in the retransmit list of the neighbor. Also do not add the LSA
in the retransmit List if already present.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
(cherry picked from commit c1e4c0dcf876ff6b352800402ff24254f8962238)

ospf6d/ospf6_flood.c

index 76e81aab7b853f295c7c7a69d2e43cf0c66bb683..8e3e35d6bdc912b3bd57c0ac085b860cced07a66 100644 (file)
@@ -275,7 +275,7 @@ void ospf6_flood_interface(struct ospf6_neighbor *from, struct ospf6_lsa *lsa,
 {
        struct listnode *node, *nnode;
        struct ospf6_neighbor *on;
-       struct ospf6_lsa *req;
+       struct ospf6_lsa *req, *old;
        int retrans_added = 0;
        int is_debug = 0;
 
@@ -383,12 +383,27 @@ void ospf6_flood_interface(struct ospf6_neighbor *from, struct ospf6_lsa *lsa,
                        if (is_debug)
                                zlog_debug("Add retrans-list of neighbor %s ",
                                           on->name);
-                       ospf6_increment_retrans_count(lsa);
-                       ospf6_lsdb_add(ospf6_lsa_copy(lsa), on->retrans_list);
-                       thread_add_timer(master, ospf6_lsupdate_send_neighbor,
-                                        on, on->ospf6_if->rxmt_interval,
-                                        &on->thread_send_lsupdate);
-                       retrans_added++;
+
+                       /* Do not increment the retrans count if the lsa is
+                        * already present in the retrans list.
+                        */
+                       old = ospf6_lsdb_lookup(
+                               lsa->header->type, lsa->header->id,
+                               lsa->header->adv_router, on->retrans_list);
+                       if (!old) {
+                               if (is_debug)
+                                       zlog_debug(
+                                               "Increment %s from retrans_list of %s",
+                                               lsa->name, on->name);
+                               ospf6_increment_retrans_count(lsa);
+                               ospf6_lsdb_add(ospf6_lsa_copy(lsa),
+                                              on->retrans_list);
+                               thread_add_timer(
+                                       master, ospf6_lsupdate_send_neighbor,
+                                       on, on->ospf6_if->rxmt_interval,
+                                       &on->thread_send_lsupdate);
+                               retrans_added++;
+                       }
                }
        }