diff options
author | Ondrej Filip <feela@network.cz> | 2000-06-02 15:52:50 +0200 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2000-06-02 15:52:50 +0200 |
commit | 62924172aef9cf5308fd21d3ad5f6572b977c268 (patch) | |
tree | 3b911da42d5e48b0d73467f7e7bb79cbc27d0d4e /proto/ospf | |
parent | 3c6269b8fec71fa22d5b087cae0e9ef86ff2b351 (diff) | |
download | bird-62924172aef9cf5308fd21d3ad5f6572b977c268.tar bird-62924172aef9cf5308fd21d3ad5f6572b977c268.zip |
Flush LSA when receive aged one.
Diffstat (limited to 'proto/ospf')
-rw-r--r-- | proto/ospf/lsalib.h | 1 | ||||
-rw-r--r-- | proto/ospf/lsupd.c | 25 |
2 files changed, 17 insertions, 9 deletions
diff --git a/proto/ospf/lsalib.h b/proto/ospf/lsalib.h index 8dc1561..4c74bc4 100644 --- a/proto/ospf/lsalib.h +++ b/proto/ospf/lsalib.h @@ -24,5 +24,6 @@ int lsa_comp(struct ospf_lsa_header *l1, struct ospf_lsa_header *l2); struct top_hash_entry *lsa_install_new(struct ospf_lsa_header *lsa, void *body, struct ospf_area *oa, struct proto *p); void ospf_age(struct ospf_area *oa); +void flush_lsa(struct top_hash_entry *en, struct ospf_area *oa); #endif /* _BIRD_OSPF_LSALIB_H_ */ diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c index f38ae33..42f44c9 100644 --- a/proto/ospf/lsupd.c +++ b/proto/ospf/lsupd.c @@ -393,15 +393,22 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p, if(lsadb) WALK_LIST(NODE ift,po->iface_list) WALK_LIST(NODE ntmp,ift->neigh_list) - { - struct top_hash_entry *en; - if(ntmp->state>NEIGHBOR_EXSTART) - if((en=ospf_hash_find_header(ntmp->lsrth,&lsadb->lsa))!=NULL) - { - s_rem_node(SNODE en); - ospf_hash_delete(ntmp->lsrth,en); - } - } + { + struct top_hash_entry *en; + if(ntmp->state>NEIGHBOR_EXSTART) + if((en=ospf_hash_find_header(ntmp->lsrth,&lsadb->lsa))!=NULL) + { + s_rem_node(SNODE en); + ospf_hash_delete(ntmp->lsrth,en); + } + } + + if((lsatmp.age==LSA_MAXAGE)&&(lsatmp.sn==LSA_MAXSEQNO) + &&lsadb&&can_flush_lsa(oa)) + { + flush_lsa(lsadb,oa); + continue; + } /* pg 144 (5d) */ body=mb_alloc(p->pool,lsatmp.length-sizeof(struct ospf_lsa_header)); |