]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Flush LSA when receive aged one.
authorOndrej Filip <feela@network.cz>
Fri, 2 Jun 2000 13:52:50 +0000 (13:52 +0000)
committerOndrej Filip <feela@network.cz>
Fri, 2 Jun 2000 13:52:50 +0000 (13:52 +0000)
proto/ospf/lsalib.h
proto/ospf/lsupd.c

index 8dc1561bfc4f28c2b46feedc28495abb8e6f705e..4c74bc48282f5c2b37142175a447c8e4ea5b727f 100644 (file)
@@ -24,5 +24,6 @@ int lsa_comp(struct ospf_lsa_header *l1, struct ospf_lsa_header *l2);
 struct top_hash_entry *lsa_install_new(struct ospf_lsa_header *lsa, void *body,
   struct ospf_area *oa, struct proto *p);
 void ospf_age(struct ospf_area *oa);
+void flush_lsa(struct top_hash_entry *en, struct ospf_area *oa);
 
 #endif /* _BIRD_OSPF_LSALIB_H_ */
index f38ae338cfd3fb62a21676ac6707bcfefc619029..42f44c922f22767f3a6280dcb83e1e31b293cb2d 100644 (file)
@@ -393,15 +393,22 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p,
       if(lsadb)
         WALK_LIST(NODE ift,po->iface_list)
           WALK_LIST(NODE ntmp,ift->neigh_list)
-         {
-           struct top_hash_entry *en;
-           if(ntmp->state>NEIGHBOR_EXSTART)
-             if((en=ospf_hash_find_header(ntmp->lsrth,&lsadb->lsa))!=NULL)
-             {
-               s_rem_node(SNODE en);
-               ospf_hash_delete(ntmp->lsrth,en);
-             }
-         }
+          {
+            struct top_hash_entry *en;
+            if(ntmp->state>NEIGHBOR_EXSTART)
+              if((en=ospf_hash_find_header(ntmp->lsrth,&lsadb->lsa))!=NULL)
+              {
+                s_rem_node(SNODE en);
+                ospf_hash_delete(ntmp->lsrth,en);
+              }
+          }
+
+      if((lsatmp.age==LSA_MAXAGE)&&(lsatmp.sn==LSA_MAXSEQNO)
+        &&lsadb&&can_flush_lsa(oa))
+      {
+        flush_lsa(lsadb,oa);
+        continue;
+      }
 
       /* pg 144 (5d) */
       body=mb_alloc(p->pool,lsatmp.length-sizeof(struct ospf_lsa_header));