From 6910315f6f3ddd66d8929cb82deaf96d13a2bfbf Mon Sep 17 00:00:00 2001 From: Xiao Liang Date: Fri, 30 Jul 2021 13:00:06 +0800 Subject: [PATCH] lib, zebra: Preserve user-configured VRF on netns deletion Don't clear VRF's user-configured flag when netns is deleted. Signed-off-by: Xiao Liang --- lib/vrf.c | 1 + zebra/zebra_netns_notify.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/vrf.c b/lib/vrf.c index 03d9a62c0f..815c0fcba2 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -287,6 +287,7 @@ void vrf_delete(struct vrf *vrf) RB_REMOVE(vrf_id_head, &vrfs_by_id, vrf); vrf->vrf_id = VRF_UNKNOWN; } + vrf->ns_ctxt = NULL; return; } diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c index 3e89df68fd..054015846f 100644 --- a/zebra/zebra_netns_notify.c +++ b/zebra/zebra_netns_notify.c @@ -149,8 +149,6 @@ static int zebra_ns_delete(char *name) "NS notify : no VRF found using NS %s", name); return 0; } - /* Clear configured flag and invoke delete. */ - UNSET_FLAG(vrf->status, VRF_CONFIGURED); ns = (struct ns *)vrf->ns_ctxt; /* the deletion order is the same * as the one used when siging signal is received -- 2.39.5