diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2021-11-05 01:54:48 +0300 | 
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-11-11 14:59:51 +0300 | 
| commit | 49df081596773e9b04c9b6a253a069602ff830e6 (patch) | |
| tree | 8735a49f37f94a8d1366d9bd035667ffda7b8058 | |
| parent | 0ac8055ca1a9662d6e8197dff9a91759331991e7 (diff) | |
zebra: fix disabling table manager
42d4b30e introduced per-VRF table manager.
Table manager is allocated when the VRF is created, but it is freed when
the VRF is disabled. When this VRF is re-enabled, zebra ends up with
table manager being NULL pointer and it crashes on any dereference.
Table manager should be freed when the VRF is deleted, not when it's
disabled.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| -rw-r--r-- | zebra/zebra_vrf.c | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c index 66d6d4b4f2..1cc7e8932b 100644 --- a/zebra/zebra_vrf.c +++ b/zebra/zebra_vrf.c @@ -184,8 +184,6 @@ static int zebra_vrf_disable(struct vrf *vrf)  		zlog_debug("VRF %s id %u is now inactive", zvrf_name(zvrf),  			   zvrf_id(zvrf)); -	table_manager_disable(zvrf); -  	/* Stop any VxLAN-EVPN processing. */  	zebra_vxlan_vrf_disable(zvrf); @@ -274,6 +272,8 @@ static int zebra_vrf_delete(struct vrf *vrf)  		zlog_debug("VRF %s id %u deleted", zvrf_name(zvrf),  			   zvrf_id(zvrf)); +	table_manager_disable(zvrf); +  	/* clean-up work queues */  	for (i = 0; i < MQ_SIZE; i++) {  		struct listnode *lnode, *nnode;  | 
