]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
I mark all LSA as in distance INFINITY in process of aging.
authorOndrej Filip <feela@network.cz>
Wed, 7 Jun 2000 23:34:43 +0000 (23:34 +0000)
committerOndrej Filip <feela@network.cz>
Wed, 7 Jun 2000 23:34:43 +0000 (23:34 +0000)
I don't have to WALK twice through it.

proto/ospf/lsalib.c
proto/ospf/rt.c

index cd294214cc892494b0373a13b00358386a60492f..3cd62a9ea34e9779cb7a7ecbb6ba3c4c57a3a7a1 100644 (file)
@@ -29,6 +29,9 @@ flush_lsa(struct top_hash_entry *en, struct ospf_area *oa)
  *
  * RFC says, that router should check checksum of every LSA to detect some
  * hardware problem. BIRD does not do it to minimalize CPU utilization.
+ *
+ * If routing table calculation is scheduled, it also invalidates old routing
+ * table calculation results.
  */
 void
 ospf_age(struct ospf_area *oa)
@@ -41,6 +44,15 @@ ospf_age(struct ospf_area *oa)
 
   WALK_SLIST_DELSAFE(en,nxt,oa->lsal)
   {
+    if(oa->calcrt)
+    {
+      en->color=OUTSPF;
+      en->dist=LSINFINITY;
+      en->nhi=NULL;
+      en->nh=ipa_from_u32(0);
+      DBG("Infinitying Type: %u, Id: %I, Rt: %I\n", en->lsa.type, en->lsa.id,
+        en->lsa.rt);
+    }
     if(en->lsa.age==LSA_MAXAGE)
     {
       if(flush) flush_lsa(en,oa);
index 46fd134b45734f0004c4fa53afea5e1a58baf9b0..910366920b5fd76e0c2eb409bc19030769a24f87 100644 (file)
@@ -59,16 +59,6 @@ ospf_rt_spfa(struct ospf_area *oa)
 
   if(oa->rt==NULL) return;
 
-  WALK_SLIST(SNODE en, oa->lsal)
-  {
-    en->color=OUTSPF;
-    en->dist=LSINFINITY;
-    en->nhi=NULL;
-    en->nh=ipa_from_u32(0);
-    DBG("Infinitying Type: %u, Id: %I, Rt: %I\n", en->lsa.type, en->lsa.id,
-      en->lsa.rt);
-  }
-
   FIB_WALK(in,nftmp)
   {
     nf=(struct infib *)nftmp;
@@ -85,7 +75,8 @@ ospf_rt_spfa(struct ospf_area *oa)
   oa->rt->dist=0;
   oa->rt->color=CANDIDATE;
   add_head(&oa->cand, &oa->rt->cn);
-  DBG("RT LSA: rt: %I, id: %I, type: %u\n",oa->rt->lsa.rt,oa->rt->lsa.id,oa->rt->lsa.type);
+  DBG("RT LSA: rt: %I, id: %I, type: %u\n",oa->rt->lsa.rt,
+    oa->rt->lsa.id,oa->rt->lsa.type);
 
   while(!EMPTY_LIST(oa->cand))
   {
@@ -97,7 +88,8 @@ ospf_rt_spfa(struct ospf_area *oa)
     act=SKIP_BACK(struct top_hash_entry, cn, n);
     rem_node(n);
 
-    DBG("Working on LSA: rt: %I, id: %I, type: %u\n",act->lsa.rt,act->lsa.id,act->lsa.type);
+    DBG("Working on LSA: rt: %I, id: %I, type: %u\n",act->lsa.rt,
+      act->lsa.id,act->lsa.type);
 
     act->color=INSPF;
     switch(act->lsa.type)
@@ -176,7 +168,7 @@ ospf_rt_spfa(struct ospf_area *oa)
     }
   }
   /* Now sync our fib with nest's */
-  DBG("\nNow syncing my rt table with nest's\n\n");
+  DBG("Now syncing my rt table with nest's\n");
   FIB_ITERATE_INIT(&fit,in);
 again:
   FIB_ITERATE_START(in,&fit,nftmp)
@@ -382,7 +374,7 @@ ospf_ext_spfa(struct proto_ospf *po)        /* FIXME looking into inter-area */
 
       if(nf==NULL)
       {
-        DBG("Cannot find network route (GW=%I\n",lt->fwaddr);
+        DBG("Cannot find network route (GW=%I)\n",lt->fwaddr);
         continue;
       }
 
@@ -441,7 +433,7 @@ ospf_ext_spfa(struct proto_ospf *po)        /* FIXME looking into inter-area */
     }
   }
 
-  DBG("\nNow syncing my rt table with nest's\n\n");
+  DBG("Now syncing my rt table with nest's\n");
   FIB_ITERATE_INIT(&fit,ef);
 noch:
   FIB_ITERATE_START(ef,&fit,nftmp)