diff options
author | Ondrej Filip <feela@network.cz> | 2000-03-30 21:37:26 +0200 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2000-03-30 21:37:26 +0200 |
commit | 95eb1dba3ffe810bd876546ca4580af3bccdf181 (patch) | |
tree | a261bb6bda3830a80c2990d7b8634eca6a1e8fa6 /proto/ospf | |
parent | 76915ec9798a2c067ef05c6fb94cea58af12128e (diff) | |
download | bird-95eb1dba3ffe810bd876546ca4580af3bccdf181.tar bird-95eb1dba3ffe810bd876546ca4580af3bccdf181.zip |
Add hashing to link state request list.
Diffstat (limited to 'proto/ospf')
-rw-r--r-- | proto/ospf/dbdes.c | 22 | ||||
-rw-r--r-- | proto/ospf/neighbor.c | 1 | ||||
-rw-r--r-- | proto/ospf/ospf.h | 3 |
3 files changed, 16 insertions, 10 deletions
diff --git a/proto/ospf/dbdes.c b/proto/ospf/dbdes.c index 4e0f2a4..9236da7 100644 --- a/proto/ospf/dbdes.c +++ b/proto/ospf/dbdes.c @@ -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); + } + } } } diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c index 0f4bbcf..b072623 100644 --- a/proto/ospf/neighbor.c +++ b/proto/ospf/neighbor.c @@ -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)); diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h index 0301154..283ccc9 100644 --- a/proto/ospf/ospf.h +++ b/proto/ospf/ospf.h @@ -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; |