summaryrefslogtreecommitdiff
path: root/proto/ospf/lsalib.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-06-07 23:48:33 +0000
committerOndrej Filip <feela@network.cz>2000-06-07 23:48:33 +0000
commit17e29574bcf0e03e3243a48e784b0248925cc5b4 (patch)
tree5bb4b726c262dbffacd7bcf4134523002b3c1060 /proto/ospf/lsalib.c
parent25a3f3da7a2312e5ae21ada2aeccc412e2d1d867 (diff)
Better algoritmus of LSA aging.
Diffstat (limited to 'proto/ospf/lsalib.c')
-rw-r--r--proto/ospf/lsalib.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/proto/ospf/lsalib.c b/proto/ospf/lsalib.c
index 3cd62a9e..6bf3577a 100644
--- a/proto/ospf/lsalib.c
+++ b/proto/ospf/lsalib.c
@@ -40,7 +40,6 @@ ospf_age(struct ospf_area *oa)
struct proto_ospf *po=(struct proto_ospf *)p;
struct top_hash_entry *en,*nxt;
int flush=can_flush_lsa(oa);
- bird_clock_t delta=now-oa->lage;
WALK_SLIST_DELSAFE(en,nxt,oa->lsal)
{
@@ -68,7 +67,7 @@ ospf_age(struct ospf_area *oa)
flood_lsa(NULL,NULL,&en->lsa,po,NULL,oa,1);
continue;
}
- if((en->lsa.age+=delta)>=LSA_MAXAGE)
+ if((en->lsa.age=(en->ini_age+(now-en->inst_t)))>=LSA_MAXAGE)
{
if(flush)
{
@@ -78,7 +77,6 @@ ospf_age(struct ospf_area *oa)
else en->lsa.age=LSA_MAXAGE;
}
}
- oa->lage=now;
}
void
@@ -454,6 +452,7 @@ lsa_install_new(struct ospf_lsa_header *lsa, void *body, struct ospf_area *oa)
if(en->lsa_body!=NULL) mb_free(en->lsa_body);
en->lsa_body=body;
memcpy(&en->lsa,lsa,sizeof(struct ospf_lsa_header));
+ en->ini_age=en->lsa.age;
if(change)
{