From 273fd2c16475d3d1275a4fe17443c3ba2b93fbc4 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Mon, 5 Jun 2000 02:23:20 +0000 Subject: 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. --- proto/ospf/lsalib.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'proto/ospf/lsalib.c') diff --git a/proto/ospf/lsalib.c b/proto/ospf/lsalib.c index 14ad099..0154504 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->ageage ? 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); -- cgit v1.2.3