mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 09:22:03 +00:00
ospfd: if destroy the whole ospf, then remove ospf's interface config: passive-interface
Signed-off-by: anlancs <anlan_cs@tom.com>
This commit is contained in:
parent
d64162ce84
commit
1113a2fb27
@ -688,10 +688,11 @@ void ospf_finish(struct ospf *ospf)
|
|||||||
/* Final cleanup of ospf instance */
|
/* Final cleanup of ospf instance */
|
||||||
static void ospf_finish_final(struct ospf *ospf)
|
static void ospf_finish_final(struct ospf *ospf)
|
||||||
{
|
{
|
||||||
struct vrf *vrf;
|
struct vrf *vrf = vrf_lookup_by_id(ospf->vrf_id);
|
||||||
struct route_node *rn;
|
struct route_node *rn;
|
||||||
struct ospf_nbr_nbma *nbr_nbma;
|
struct ospf_nbr_nbma *nbr_nbma;
|
||||||
struct ospf_lsa *lsa;
|
struct ospf_lsa *lsa;
|
||||||
|
struct interface *ifp;
|
||||||
struct ospf_interface *oi;
|
struct ospf_interface *oi;
|
||||||
struct ospf_area *area;
|
struct ospf_area *area;
|
||||||
struct ospf_vl_data *vl_data;
|
struct ospf_vl_data *vl_data;
|
||||||
@ -739,6 +740,15 @@ static void ospf_finish_final(struct ospf *ospf)
|
|||||||
if (ospf->vrf_id == VRF_DEFAULT)
|
if (ospf->vrf_id == VRF_DEFAULT)
|
||||||
ospf_ldp_sync_gbl_exit(ospf, true);
|
ospf_ldp_sync_gbl_exit(ospf, true);
|
||||||
|
|
||||||
|
/* Remove ospf interface config params: only passive-interface */
|
||||||
|
FOR_ALL_INTERFACES (vrf, ifp) {
|
||||||
|
struct ospf_if_params *params;
|
||||||
|
|
||||||
|
params = IF_DEF_PARAMS(ifp);
|
||||||
|
if (OSPF_IF_PARAM_CONFIGURED(params, passive_interface))
|
||||||
|
UNSET_IF_PARAM(params, passive_interface);
|
||||||
|
}
|
||||||
|
|
||||||
/* Reset interface. */
|
/* Reset interface. */
|
||||||
for (ALL_LIST_ELEMENTS(ospf->oiflist, node, nnode, oi))
|
for (ALL_LIST_ELEMENTS(ospf->oiflist, node, nnode, oi))
|
||||||
ospf_if_free(oi);
|
ospf_if_free(oi);
|
||||||
@ -898,17 +908,11 @@ static void ospf_finish_final(struct ospf *ospf)
|
|||||||
ospf->max_multipath = MULTIPATH_NUM;
|
ospf->max_multipath = MULTIPATH_NUM;
|
||||||
ospf_delete(ospf);
|
ospf_delete(ospf);
|
||||||
|
|
||||||
if (ospf->name) {
|
if (vrf)
|
||||||
vrf = vrf_lookup_by_name(ospf->name);
|
ospf_vrf_unlink(ospf, vrf);
|
||||||
if (vrf)
|
|
||||||
ospf_vrf_unlink(ospf, vrf);
|
|
||||||
XFREE(MTYPE_OSPF_TOP, ospf->name);
|
|
||||||
} else {
|
|
||||||
vrf = vrf_lookup_by_id(VRF_DEFAULT);
|
|
||||||
if (vrf)
|
|
||||||
ospf_vrf_unlink(ospf, vrf);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (ospf->name)
|
||||||
|
XFREE(MTYPE_OSPF_TOP, ospf->name);
|
||||||
XFREE(MTYPE_OSPF_TOP, ospf);
|
XFREE(MTYPE_OSPF_TOP, ospf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user