]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: Fix initial Opaque LSA DB synchronisation
authorOlivier Dugeon <olivier.dugeon@orange.com>
Mon, 3 Nov 2014 13:59:06 +0000 (14:59 +0100)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 26 May 2016 15:24:51 +0000 (15:24 +0000)
ospfd has issues resynchronising its Opaque LSA DB with neighbours after restart
or interface events. The problem comes from opaque_lsa.c code that blocks
subsequent opaque LSA flooding until the neighbour router acknowledge that, and
removes the old opaque LSA from its LSDB. The bug comes from the fact that the
lock is never release, thus avoiding subsequent opaque LSA flooding.

More detail about the bugs and its solution is describeid in file
doc/te-link-params.md

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
(cherry picked from commit 149210656045c363d8f59b97ad9251b0c06a15df)

ospfd/ospf_opaque.c

index 48e12cecbdfcf5eeabb6b2ff87eb89f632a2072a..00868dd5c1cff6fe32bf7461b49255d5db2b7ef2 100644 (file)
@@ -2132,10 +2132,12 @@ out:
  *------------------------------------------------------------------------*/
 
 static void ospf_opaque_exclude_lsa_from_lsreq (struct route_table *nbrs, struct ospf_neighbor *inbr, struct ospf_lsa *lsa);
+#ifdef BUGGY_UNLOCK
 static void ospf_opaque_type9_lsa_rxmt_nbr_check (struct ospf_interface *oi);
 static void ospf_opaque_type10_lsa_rxmt_nbr_check (struct ospf_area *area);
 static void ospf_opaque_type11_lsa_rxmt_nbr_check (struct ospf *top);
 static unsigned long ospf_opaque_nrxmt_self (struct route_table *nbrs, int lsa_type);
+#endif /* BUGGY_UNLOCK */
 
 void
 ospf_opaque_adjust_lsreq (struct ospf_neighbor *nbr, struct list *lsas)
@@ -2302,17 +2304,20 @@ ospf_opaque_ls_ack_received (struct ospf_neighbor *nbr, struct ospf_lsa *lsa)
     {
     case OSPF_OPAQUE_LINK_LSA:
       if (CHECK_FLAG (top->opaque, OPAQUE_BLOCK_TYPE_09_LSA_BIT))
-        ospf_opaque_type9_lsa_rxmt_nbr_check (nbr->oi);
+        UNSET_FLAG (top->opaque, OPAQUE_BLOCK_TYPE_09_LSA_BIT);
+        /* BUGGY_UNLOCK: ospf_opaque_type9_lsa_rxmt_nbr_check (nbr->oi); */
       /* Callback function... */
       break;
     case OSPF_OPAQUE_AREA_LSA:
       if (CHECK_FLAG (top->opaque, OPAQUE_BLOCK_TYPE_10_LSA_BIT))
-        ospf_opaque_type10_lsa_rxmt_nbr_check (nbr->oi->area);
+        UNSET_FLAG (top->opaque, OPAQUE_BLOCK_TYPE_10_LSA_BIT);
+        /* BUGGY_UNLOCK: ospf_opaque_type10_lsa_rxmt_nbr_check (nbr->oi->area); */
       /* Callback function... */
       break;
     case OSPF_OPAQUE_AS_LSA:
       if (CHECK_FLAG (top->opaque, OPAQUE_BLOCK_TYPE_11_LSA_BIT))
-        ospf_opaque_type11_lsa_rxmt_nbr_check (top);
+        UNSET_FLAG (top->opaque, OPAQUE_BLOCK_TYPE_11_LSA_BIT);
+        /* BUGGY_UNLOCK: ospf_opaque_type11_lsa_rxmt_nbr_check (top); */
       /* Callback function... */
       break;
     default:
@@ -2321,11 +2326,10 @@ ospf_opaque_ls_ack_received (struct ospf_neighbor *nbr, struct ospf_lsa *lsa)
     }
   
   if (IS_OPAQUE_LSA_ORIGINATION_BLOCKED (top->opaque))
-    {
-      if (IS_DEBUG_OSPF_EVENT)
-        zlog_debug ("Block Opaque-LSA origination: ON -> OFF");
       return; /* Blocking still in progress. */
-    }
+
+  if (IS_DEBUG_OSPF_EVENT)
+    zlog_debug ("Block Opaque-LSA origination: ON -> OFF");
   
   if (! CHECK_FLAG (top->config, OSPF_OPAQUE_CAPABLE))
     return; /* Opaque capability condition must have changed. */
@@ -2345,6 +2349,7 @@ ospf_opaque_ls_ack_received (struct ospf_neighbor *nbr, struct ospf_lsa *lsa)
   return;
 }
 
+#ifdef BUGGY_UNLOCK
 static void
 ospf_opaque_type9_lsa_rxmt_nbr_check (struct ospf_interface *oi)
 {
@@ -2445,6 +2450,7 @@ ospf_opaque_nrxmt_self (struct route_table *nbrs, int lsa_type)
 
   return n;
 }
+#endif /* BUGGY_UNLOCK */
 
 /*------------------------------------------------------------------------*
  * Followings are util functions; probably be used by Opaque-LSAs only...