summaryrefslogtreecommitdiffstats
path: root/proto/ospf/lsalib.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-06-04 21:21:23 +0200
committerOndrej Filip <feela@network.cz>2000-06-04 21:21:23 +0200
commitdab66519160042f1fb62a285e3a947233ce74e70 (patch)
tree67be436b5687e4a2ce9ec69112c6a56c07cd87aa /proto/ospf/lsalib.c
parent67cc9135bfd515149ecca62f32026cd6e2a390b0 (diff)
downloadbird-dab66519160042f1fb62a285e3a947233ce74e70.tar
bird-dab66519160042f1fb62a285e3a947233ce74e70.zip
Install newer lsa even if nothing in its body change.
Diffstat (limited to 'proto/ospf/lsalib.c')
-rw-r--r--proto/ospf/lsalib.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/proto/ospf/lsalib.c b/proto/ospf/lsalib.c
index 618a24e..9cfddc0 100644
--- a/proto/ospf/lsalib.c
+++ b/proto/ospf/lsalib.c
@@ -39,9 +39,13 @@ ospf_age(struct ospf_area *oa)
lsasum_calculate(&en->lsa,en->lsa_body,po);
return;
}
- if((en->lsa.age+=delta)>LSA_MAXAGE)
+ if((en->lsa.age+=delta)>=LSA_MAXAGE)
{
- if(flush) flush_lsa(en,oa);
+ if(flush)
+ {
+ flush_lsa(en,oa);
+ schedule_rtcalc(oa);
+ }
else en->lsa.age=LSA_MAXAGE;
}
}
@@ -364,6 +368,7 @@ 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;
@@ -379,6 +384,8 @@ 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);
@@ -403,18 +410,15 @@ lsa_install_new(struct ospf_lsa_header *lsa, void *body, struct ospf_area *oa,
if(change) s_rem_node(SNODE en);
}
+ s_add_tail(&oa->lsal, SNODE en);
+ en->inst_t=now;
+ if(en->lsa_body!=NULL) mb_free(en->lsa_body);
+ en->lsa_body=body;
+ memcpy(&en->lsa,lsa,sizeof(struct ospf_lsa_header));
+
if(change)
{
- s_add_tail(&oa->lsal, SNODE en);
- en->inst_t=now;
- if(en->lsa_body!=NULL) mb_free(en->lsa_body);
- en->lsa_body=body;
- memcpy(&en->lsa,lsa,sizeof(struct ospf_lsa_header));
- /* FIXME decide if route calculation must be done and how */
- if(oa->rt!=NULL)
- {
- schedule_rtcalc(oa);
- }
+ schedule_rtcalc(oa);
}
return en;