]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: unset default route external_info
authorDavid Lamparter <equinox@diac24.net>
Mon, 29 Jul 2019 10:43:46 +0000 (12:43 +0200)
committerDavid Lamparter <equinox@diac24.net>
Fri, 2 Aug 2019 09:29:03 +0000 (11:29 +0200)
Need to clear out the external_info for the "always" default route that
we installed in ospf_redistribute_default_set().

Signed-off-by: David Lamparter <equinox@diac24.net>
ospfd/ospf_zebra.c

index 714b3bb8178ca98d622f1c1b957add2480035bf7..0519092e40276beede0b7d5d39db7ea76e708257 100644 (file)
@@ -845,6 +845,14 @@ int ospf_redistribute_default_unset(struct ospf *ospf)
                        return CMD_SUCCESS;
                zclient_redistribute_default(ZEBRA_REDISTRIBUTE_DEFAULT_DELETE,
                                 zclient, AFI_IP, ospf->vrf_id);
+       } else if (ospf->default_originate == DEFAULT_ORIGINATE_ALWAYS) {
+               struct prefix_ipv4 p;
+
+               p.family = AF_INET;
+               p.prefix.s_addr = 0;
+               p.prefixlen = 0;
+
+               ospf_external_info_delete(ospf, DEFAULT_ROUTE, 0, &p);
        }
 
        ospf->default_originate = DEFAULT_ORIGINATE_NONE;
@@ -852,8 +860,6 @@ int ospf_redistribute_default_unset(struct ospf *ospf)
        if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE))
                zlog_debug("Redistribute[DEFAULT]: Stop");
 
-       // Pending: how does the external_info cleanup work in this case?
-
        ospf_asbr_status_update(ospf, --ospf->redistribute);
 
        return CMD_SUCCESS;