summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-03-22 16:56:12 +0100
committerGitHub <noreply@github.com>2019-03-22 16:56:12 +0100
commit6b38a03312d0e5602436c18a0077cffd17a69451 (patch)
treeb35cd5821ec2e2a0f9c2af25b6159d237418d6ab /zebra
parentMerge pull request #3935 from FRRouting/doc-add-fabricd-seealso (diff)
parentzebra: Cleanup rnh table information before deleting underlying tables (diff)
downloadfrr-6b38a03312d0e5602436c18a0077cffd17a69451.tar.xz
frr-6b38a03312d0e5602436c18a0077cffd17a69451.zip
Merge pull request #3927 from donaldsharp/rnh_cleanup
zebra: Cleanup rnh table information before deleting underlying tables
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_vrf.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c
index 1300ca24f..90f94902f 100644
--- a/zebra/zebra_vrf.c
+++ b/zebra/zebra_vrf.c
@@ -167,6 +167,11 @@ static int zebra_vrf_disable(struct vrf *vrf)
/* Remove all routes. */
for (afi = AFI_IP; afi <= AFI_IP6; afi++) {
+ route_table_finish(zvrf->rnh_table[afi]);
+ zvrf->rnh_table[afi] = NULL;
+ route_table_finish(zvrf->import_check_table[afi]);
+ zvrf->import_check_table[afi] = NULL;
+
for (safi = SAFI_UNICAST; safi <= SAFI_MULTICAST; safi++)
rib_close_table(zvrf->table[afi][safi]);
}
@@ -213,11 +218,6 @@ static int zebra_vrf_disable(struct vrf *vrf)
safi);
zvrf->table[afi][safi] = NULL;
}
-
- route_table_finish(zvrf->rnh_table[afi]);
- zvrf->rnh_table[afi] = NULL;
- route_table_finish(zvrf->import_check_table[afi]);
- zvrf->import_check_table[afi] = NULL;
}
return 0;
@@ -268,8 +268,10 @@ static int zebra_vrf_delete(struct vrf *vrf)
}
}
- route_table_finish(zvrf->rnh_table[afi]);
- route_table_finish(zvrf->import_check_table[afi]);
+ if (zvrf->rnh_table[afi])
+ route_table_finish(zvrf->rnh_table[afi]);
+ if (zvrf->import_check_table[afi])
+ route_table_finish(zvrf->import_check_table[afi]);
}
/* Cleanup EVPN states for vrf */