summaryrefslogtreecommitdiffstats
path: root/proto/ospf/lsalib.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto/ospf/lsalib.c')
-rw-r--r--proto/ospf/lsalib.c41
1 files changed, 24 insertions, 17 deletions
diff --git a/proto/ospf/lsalib.c b/proto/ospf/lsalib.c
index d462bbd..62ea0b8 100644
--- a/proto/ospf/lsalib.c
+++ b/proto/ospf/lsalib.c
@@ -16,28 +16,35 @@ flush_lsa(struct top_hash_entry *en, struct ospf_area *oa)
}
void
-ospf_age(struct top_hash_entry *en, bird_clock_t delta, int flush,
- struct ospf_area *oa)
+ospf_age(struct ospf_area *oa)
{
struct proto *p=&oa->po->proto;
struct proto_ospf *po=(struct proto_ospf *)p;
- if(en->lsa.age==LSA_MAXAGE)
- {
- if(flush) flush_lsa(en,oa);
- return;
- }
- if((en->lsa.rt==p->cf->global->router_id)&&(en->lsa.age>LSREFRESHTIME))
- {
- en->lsa.sn++;
- en->lsa.age=0;
- flood_lsa(NULL,NULL,&en->lsa,po,NULL,oa,1);
- return;
- }
- if((en->lsa.age+=delta)>LSA_MAXAGE)
+ 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)
{
- if(flush) flush_lsa(en,oa);
- else en->lsa.age=LSA_MAXAGE;
+ if(en->lsa.age==LSA_MAXAGE)
+ {
+ if(flush) flush_lsa(en,oa);
+ return;
+ }
+ if((en->lsa.rt==p->cf->global->router_id)&&(en->lsa.age>LSREFRESHTIME))
+ {
+ en->lsa.sn++;
+ en->lsa.age=0;
+ flood_lsa(NULL,NULL,&en->lsa,po,NULL,oa,1);
+ return;
+ }
+ if((en->lsa.age+=delta)>LSA_MAXAGE)
+ {
+ if(flush) flush_lsa(en,oa);
+ else en->lsa.age=LSA_MAXAGE;
+ }
}
+ oa->lage=now;
}
void