]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Add hashing to link state request list.
authorOndrej Filip <feela@network.cz>
Thu, 30 Mar 2000 19:37:26 +0000 (19:37 +0000)
committerOndrej Filip <feela@network.cz>
Thu, 30 Mar 2000 19:37:26 +0000 (19:37 +0000)
proto/ospf/dbdes.c
proto/ospf/neighbor.c
proto/ospf/ospf.h

index 4e0f2a4972509dd3e92ee958e722d7ed7cdeb1c5..9236da75a3bc2324f6980c082885a1754f4e7630 100644 (file)
@@ -234,15 +234,19 @@ ospf_dbdes_reqladd(struct ospf_dbdes_packet *ps, struct proto *p,
 
   for(i=0;i<j;i++)
   {
-  ntohlsah(plsa+i, &lsa);
-  /* FIXME Test Checksum */
-  if(((he=ospf_hash_find(gr,lsa.id,lsa.rt,lsa.type))==NULL)||
-    (lsa_comp(&lsa, &(he->lsa))==1))
-  {
-     sn=sl_alloc(gr->hash_slab);
-     ntohlsah(plsa+i, &(sn->lsa));
-     s_add_tail(&(n->lsrql), SNODE sn);
-  }
+    ntohlsah(plsa+i, &lsa);
+    /* FIXME Test Checksum */
+    if(((he=ospf_hash_find(gr,lsa.id,lsa.rt,lsa.type))==NULL)||
+      (lsa_comp(&lsa, &(he->lsa))==1))
+    {
+      /* Is this confition necessary? */
+      if(ospf_hash_find(n->lsrqh,lsa.id,lsa.rt,lsa.type)==NULL)
+      {
+        sn=ospf_hash_get(n->lsrqh,lsa.id,lsa.rt,lsa.type);
+        ntohlsah(plsa+i, &(sn->lsa));
+        s_add_tail(&(n->lsrql), SNODE sn);
+      }
+    }
   }
 }
 
index 0f4bbcf07254ce2616c353590feeeb5a35163566..b07262360285c8e14c3f0818b992827d14fa5ecb 100644 (file)
@@ -208,6 +208,7 @@ ospf_neigh_sm(struct ospf_neighbor *n, int event)
       {
         neigh_chstate(n,NEIGHBOR_EXCHANGE);
         s_init_list(&(n->lsrql));
+       n->lsrqh=ospf_top_new(n->ifa->proto);
         s_init_list(&(n->lsrtl));
        s_init(&(n->dbsi), &(n->ifa->oa->lsal));
        s_init(&(n->lsrqi), &(n->lsrql));
index 0301154ebbb3ab0c4197240dff4dda3cc7a74915..283ccc9aff7f25dbe0f40bb84e8c978c98703e68 100644 (file)
@@ -272,7 +272,8 @@ struct ospf_neighbor
   u32 bdr;             /* Neigbour's idea of BDR */
   u8 adj;              /* built adjacency? */
   siterator dbsi;      /* Database summary list iterator */
-  slist lsrql;         /* Link state request */ /* FIXME add hashing? */
+  slist lsrql;         /* Link state request */
+  struct top_graph *lsrqh;             /* LSA graph */
   siterator lsrqi;
   slist lsrtl;         /* Link state retransmission list */
   siterator lsrti;