summaryrefslogtreecommitdiff
path: root/proto/ospf
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
parent25a3f3da7a2312e5ae21ada2aeccc412e2d1d867 (diff)
Better algoritmus of LSA aging.
Diffstat (limited to 'proto/ospf')
-rw-r--r--proto/ospf/lsalib.c5
-rw-r--r--proto/ospf/ospf.c1
-rw-r--r--proto/ospf/ospf.h1
-rw-r--r--proto/ospf/topology.h2
4 files changed, 4 insertions, 5 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)
{
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index a7fb650e..11daba19 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -102,7 +102,6 @@ ospf_start(struct proto *p)
oa->disp_timer->randomize=0;
oa->disp_timer->hook=area_disp;
oa->disp_timer->recurrent=oa->tick;
- oa->lage=now;
tm_start(oa->disp_timer,oa->tick);
oa->calcrt=0;
oa->origrt=0;
diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h
index 443eec0d..d22b617c 100644
--- a/proto/ospf/ospf.h
+++ b/proto/ospf/ospf.h
@@ -350,7 +350,6 @@ struct ospf_area {
node n;
u32 areaid;
timer *disp_timer; /* Area's dispatcher hear beat */
- bird_clock_t lage; /* Time of last aging */
int calcrt; /* Routing table calculation scheduled? */
int origrt; /* Rt lsa origination scheduled? */
struct top_graph *gr; /* LSA graph */
diff --git a/proto/ospf/topology.h b/proto/ospf/topology.h
index 3a475085..ca3096e4 100644
--- a/proto/ospf/topology.h
+++ b/proto/ospf/topology.h
@@ -19,11 +19,13 @@ struct top_hash_entry { /* Index for fast mapping (type,rtrid,LSid)->vertex */
ip_addr nh; /* Next hop */
struct iface *nhi;
u16 dist; /* Distance from the root */
+ u16 ini_age;
u8 color;
#define OUTSPF 0
#define CANDIDATE 1
#define INSPF 2
u8 padding;
+ u16 padding2;
};
struct top_graph {