]> git.puffer.fish Git - mirror/frr.git/commitdiff
[ospfd] Do not use stale Network/Router LSAs
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Mon, 5 Jan 2009 16:44:46 +0000 (17:44 +0100)
committerPaul Jakma <paul@quagga.net>
Fri, 26 Jun 2009 15:12:19 +0000 (16:12 +0100)
Should a self originated Network/Router LSA with higher
LS seq. nr. be received we should flood and install it in
the LSDB but we cannot use it for our internal calculations
as it is stale.
Reorginate an new LSA to replace the stale one as soon
as possible.

ospfd/ospf_flood.c
ospfd/ospf_lsa.c

index 0f485fe30eb7f2f7d4f29d89af038d997519efa4..41661da2f46c44fe3523c84b0bf2dbdb78d4a682 100644 (file)
@@ -133,10 +133,8 @@ ospf_process_self_originated_lsa (struct ospf *ospf,
     {
     case OSPF_ROUTER_LSA:
       /* Originate a new instance and schedule flooding */
-      /* It shouldn't be necessary, but anyway */
-      ospf_lsa_unlock (&area->router_lsa_self);
-      area->router_lsa_self = ospf_lsa_lock (new);
-
+      if (area->router_lsa_self)
+       area->router_lsa_self->data->ls_seqnum = new->data->ls_seqnum;
       ospf_router_lsa_timer_add (area);
       return;
     case OSPF_NETWORK_LSA:
@@ -170,9 +168,8 @@ ospf_process_self_originated_lsa (struct ospf *ospf,
               }
 #endif /* HAVE_OPAQUE_LSA */
 
-            ospf_lsa_unlock (&oi->network_lsa_self);
-            oi->network_lsa_self = ospf_lsa_lock (new);
-            
+            if (oi->network_lsa_self)
+             oi->network_lsa_self->data->ls_seqnum = new->data->ls_seqnum;
             /* Schedule network-LSA origination. */
             ospf_network_lsa_timer_add (oi);
             return;
index 18eed79e72d89de159427bd4222d8283e70f57c3..15a6a4c4b6097bf58bae1753fe01c8fad4e9eb9c 100644 (file)
@@ -2451,7 +2451,10 @@ ospf_router_lsa_install (struct ospf *ospf,
   if (rt_recalc)
     ospf_spf_calculate_schedule (ospf);
 
-  if (IS_LSA_SELF (new))
+  /* Only install LSA if it is originated/refreshed by us.
+   * If LSA was received by flooding, the RECEIVED flag is set so do
+   * not link the LSA */
+  if (IS_LSA_SELF (new) && !CHECK_FLAG (new->flags, OSPF_LSA_RECEIVED))
     {
       /* Set router-LSA refresh timer. */
       OSPF_TIMER_OFF (area->t_router_lsa_self);