diff options
-rw-r--r-- | ospfd/ospf_lsa.c | 16 | ||||
-rw-r--r-- | ospfd/ospf_lsa.h | 1 | ||||
-rw-r--r-- | ospfd/ospf_zebra.c | 3 |
3 files changed, 20 insertions, 0 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index 288ce43f7..609effd87 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -2249,6 +2249,22 @@ void ospf_external_lsa_refresh_default(struct ospf *ospf) } } +void ospf_default_originate_lsa_update(struct ospf *ospf) +{ + struct prefix_ipv4 p; + struct ospf_lsa *lsa; + + p.family = AF_INET; + p.prefixlen = 0; + p.prefix.s_addr = 0; + + lsa = ospf_external_info_find_lsa(ospf, &p); + if (lsa && IS_LSA_MAXAGE(lsa)) { + ospf_discard_from_db(ospf, lsa->lsdb, lsa); + ospf_lsdb_delete(lsa->lsdb, lsa); + } +} + void ospf_external_lsa_refresh_type(struct ospf *ospf, uint8_t type, unsigned short instance, int force) { diff --git a/ospfd/ospf_lsa.h b/ospfd/ospf_lsa.h index ba4c4c1ca..4b4d760f4 100644 --- a/ospfd/ospf_lsa.h +++ b/ospfd/ospf_lsa.h @@ -296,6 +296,7 @@ extern int ospf_lsa_maxage_walker(struct thread *); extern struct ospf_lsa *ospf_lsa_refresh(struct ospf *, struct ospf_lsa *); extern void ospf_external_lsa_refresh_default(struct ospf *); +extern void ospf_default_originate_lsa_update(struct ospf *ospf); extern void ospf_external_lsa_refresh_type(struct ospf *, uint8_t, unsigned short, int); diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index 79ddb192c..991d0063d 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -869,6 +869,9 @@ int ospf_redistribute_default_unset(struct ospf *ospf) ospf_asbr_status_update(ospf, --ospf->redistribute); + /* clean up maxage default originate external lsa */ + ospf_default_originate_lsa_update(ospf); + return CMD_SUCCESS; } |