summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-06-04 11:06:51 +0300
committerGitHub <noreply@github.com>2021-06-04 11:06:51 +0300
commit10ddcc321a59de099ee357fd5cca229a8c3110bf (patch)
tree5de6c719d98e66d8fa6c18894eb3f3773b9c2880
parent0940d2bddc25fb2e30501dea6da0dbc0a7706a74 (diff)
parent1113a2fb271a49ad4b2d2c531cc924e37919c351 (diff)
Merge pull request #8776 from anlancs/fix-ospf-cli-passive-interface
ospfd: remove ospf interface config: passive-interface
-rw-r--r--ospfd/ospfd.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index 7505f24aef..38c0ca2b67 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -688,10 +688,11 @@ void ospf_finish(struct ospf *ospf)
/* Final cleanup of ospf instance */
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 ospf_nbr_nbma *nbr_nbma;
struct ospf_lsa *lsa;
+ struct interface *ifp;
struct ospf_interface *oi;
struct ospf_area *area;
struct ospf_vl_data *vl_data;
@@ -739,6 +740,15 @@ static void ospf_finish_final(struct ospf *ospf)
if (ospf->vrf_id == VRF_DEFAULT)
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. */
for (ALL_LIST_ELEMENTS(ospf->oiflist, node, nnode, oi))
ospf_if_free(oi);
@@ -898,17 +908,11 @@ static void ospf_finish_final(struct ospf *ospf)
ospf->max_multipath = MULTIPATH_NUM;
ospf_delete(ospf);
- if (ospf->name) {
- vrf = vrf_lookup_by_name(ospf->name);
- 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 (vrf)
+ ospf_vrf_unlink(ospf, vrf);
+ if (ospf->name)
+ XFREE(MTYPE_OSPF_TOP, ospf->name);
XFREE(MTYPE_OSPF_TOP, ospf);
}