diff options
author | Chirag Shah <chirag@cumulusnetworks.com> | 2019-01-15 01:55:44 +0100 |
---|---|---|
committer | Chirag Shah <chirag@cumulusnetworks.com> | 2019-01-16 06:06:58 +0100 |
commit | 313919d6e3db67eedef77960ea4e2ba2a6018ee1 (patch) | |
tree | 707910c80fa15c1769e1bcabe4437a9e23bbe869 /ospfd | |
parent | Merge pull request #3617 from donaldsharp/cleanup_old_stale_netlink (diff) | |
download | frr-313919d6e3db67eedef77960ea4e2ba2a6018ee1.tar.xz frr-313919d6e3db67eedef77960ea4e2ba2a6018ee1.zip |
ospfd: remove default origin max age lsa
default-information originate does not work
if config is removed and re-added.
Ticket:CM-20026
Testing Done:
Validate default-information originate config
removed and re-added, check ospf lsa database, and peer
route cache entry for default route.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'ospfd')
-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; } |