mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-15 23:19:13 +00:00
lib: fix crash when terminating inactive VRFs
If the VRF is not enabled, if_terminate deletes the VRF after the last interface is removed from it. Therefore daemons crash on the subsequent call to vrf_delete. We should call vrf_delete only for enabled VRFs. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
9acc98c865
commit
d2dbaf3b5e
@ -539,9 +539,12 @@ void vrf_init(int (*create)(struct vrf *), int (*enable)(struct vrf *),
|
|||||||
|
|
||||||
static void vrf_terminate_single(struct vrf *vrf)
|
static void vrf_terminate_single(struct vrf *vrf)
|
||||||
{
|
{
|
||||||
|
int enabled = vrf_is_enabled(vrf);
|
||||||
|
|
||||||
/* Clear configured flag and invoke delete. */
|
/* Clear configured flag and invoke delete. */
|
||||||
UNSET_FLAG(vrf->status, VRF_CONFIGURED);
|
UNSET_FLAG(vrf->status, VRF_CONFIGURED);
|
||||||
if_terminate(vrf);
|
if_terminate(vrf);
|
||||||
|
if (enabled)
|
||||||
vrf_delete(vrf);
|
vrf_delete(vrf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user