summaryrefslogtreecommitdiff
path: root/ospfd/ospf_interface.c
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2021-11-11 18:41:02 -0500
committerGitHub <noreply@github.com>2021-11-11 18:41:02 -0500
commit13576f45f8a04f1d1b0094025b9156d7f2c9d995 (patch)
tree09ef8bf191bf1bf86cb2905f9bd2109198c584dc /ospfd/ospf_interface.c
parent66e108cc255e416913dbbb5ad07ddc00aaa73c5f (diff)
parentce27a13e90885de3a830e4ec78afc9efeadae42e (diff)
Merge pull request #9981 from idryzhov/fix-vrf-delete
lib: fix vrf deletion when the last interface is deleted
Diffstat (limited to 'ospfd/ospf_interface.c')
-rw-r--r--ospfd/ospf_interface.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 8bd20b79d0..42d31414f5 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -971,11 +971,14 @@ struct ospf_interface *ospf_vl_new(struct ospf *ospf,
static void ospf_vl_if_delete(struct ospf_vl_data *vl_data)
{
struct interface *ifp = vl_data->vl_oi->ifp;
+ struct vrf *vrf = ifp->vrf;
vl_data->vl_oi->address->u.prefix4.s_addr = INADDR_ANY;
vl_data->vl_oi->address->prefixlen = 0;
ospf_if_free(vl_data->vl_oi);
if_delete(&ifp);
+ if (!vrf_is_enabled(vrf))
+ vrf_delete(vrf);
vlink_count--;
}