diff options
author | Ondrej Filip <feela@network.cz> | 2000-06-05 02:23:20 +0000 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2000-06-05 02:23:20 +0000 |
commit | 273fd2c16475d3d1275a4fe17443c3ba2b93fbc4 (patch) | |
tree | 20e359ed2d2bfa79cf2acac2a8bbaeedde6116be /proto/ospf/lsalib.c | |
parent | 2d37d36c676e16b92ac38a60d3c269efeeaf07ac (diff) |
Many bugfixes (I don't remember all of them):
Added link ID calculation for external routes with same prefix but
different mask.
Bugfix in NET lsa origination.
Bugfix in NET hashing.
Bugfix in LSA installing.
Diffstat (limited to 'proto/ospf/lsalib.c')
-rw-r--r-- | proto/ospf/lsalib.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/proto/ospf/lsalib.c b/proto/ospf/lsalib.c index 14ad099b..01545044 100644 --- a/proto/ospf/lsalib.c +++ b/proto/ospf/lsalib.c @@ -11,6 +11,8 @@ void flush_lsa(struct top_hash_entry *en, struct ospf_area *oa) { + debug("Going to remove node: Type: %u, Id: %I, Rt: %I, Age: %u\n", + en->lsa.type, en->lsa.id, en->lsa.rt, en->lsa.age); s_rem_node(SNODE en); ospf_hash_delete(oa->gr,en); } @@ -368,7 +370,6 @@ lsa_comp(struct ospf_lsa_header *l1, struct ospf_lsa_header *l2) if((l1->age==LSA_MAXAGE)&&(l2->age!=LSA_MAXAGE)) return CMP_NEWER; if((l2->age==LSA_MAXAGE)&&(l1->age!=LSA_MAXAGE)) return CMP_OLDER; - debug("Abs=%u\n",abs(l1->age-l2->age)); if(abs(l1->age-l2->age)>LSA_MAXAGEDIFF) return l1->age<l2->age ? CMP_NEWER : CMP_OLDER; @@ -384,8 +385,6 @@ lsa_install_new(struct ospf_lsa_header *lsa, void *body, struct ospf_area *oa, unsigned i; struct top_hash_entry *en; - if(body==NULL) die("AA"); - if((en=ospf_hash_find_header(oa->gr,lsa))==NULL) { en=ospf_hash_get_header(oa->gr,lsa); @@ -407,9 +406,12 @@ lsa_install_new(struct ospf_lsa_header *lsa, void *body, struct ospf_area *oa, } } } - if(change) s_rem_node(SNODE en); + s_rem_node(SNODE en); } + DBG("Inst lsa: Id: %I, Rt: %I, Type: %u, Age: %u, Sum: %u, Sn: 0x%x\n", + lsa->id, lsa->rt, lsa->type, lsa->age, lsa->checksum, lsa->sn); + s_add_tail(&oa->lsal, SNODE en); en->inst_t=now; if(en->lsa_body!=NULL) mb_free(en->lsa_body); |