summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_evpn.c8
-rw-r--r--bgpd/bgp_evpn_vty.c5
-rw-r--r--zebra/zebra_vxlan.c4
3 files changed, 9 insertions, 8 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
index 82cfd71f6c..840828228b 100644
--- a/bgpd/bgp_evpn.c
+++ b/bgpd/bgp_evpn.c
@@ -417,7 +417,7 @@ static void unmap_vrf_from_rt(struct bgp *bgp_vrf,
/* Delete VRF from list for this RT. */
listnode_delete(irt->vrfs, bgp_vrf);
if (!listnode_head(irt->vrfs)) {
- list_free(irt->vrfs);
+ list_delete_and_null(&irt->vrfs);
vrf_import_rt_free(irt);
}
}
@@ -3886,13 +3886,13 @@ void bgp_evpn_cleanup(struct bgp *bgp)
hash_free(bgp->vnihash);
bgp->vnihash = NULL;
if (bgp->vrf_import_rtl)
- list_delete(bgp->vrf_import_rtl);
+ list_delete_and_null(&bgp->vrf_import_rtl);
bgp->vrf_import_rtl = NULL;
if (bgp->vrf_export_rtl)
- list_delete(bgp->vrf_export_rtl);
+ list_delete_and_null(&bgp->vrf_export_rtl);
bgp->vrf_export_rtl = NULL;
if (bgp->l2vnis)
- list_delete(bgp->l2vnis);
+ list_delete_and_null(&bgp->l2vnis);
bgp->l2vnis = NULL;
bf_free(bgp->rd_idspace);
}
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c
index fe0d4c0ca9..04455e64be 100644
--- a/bgpd/bgp_evpn_vty.c
+++ b/bgpd/bgp_evpn_vty.c
@@ -419,14 +419,15 @@ static void evpn_show_vrf_routes(struct vty *vty,
struct bgp_info *ri;
int header = 1;
u_int32_t prefix_cnt, path_cnt;
+ struct bgp_table *table;
prefix_cnt = path_cnt = 0;
bgp_def = bgp_get_default();
if (!bgp_def)
return;
- for (rn = bgp_table_top(bgp_vrf->rib[AFI_L2VPN][SAFI_EVPN]); rn;
- rn = bgp_route_next(rn)) {
+ table = (struct bgp_table *)bgp_vrf->rib[AFI_L2VPN][SAFI_EVPN];
+ for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {
char prefix_str[BUFSIZ];
bgp_evpn_route2str((struct prefix_evpn *)&rn->p, prefix_str,
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c
index 8a6cc9dfe0..5e0ef54a39 100644
--- a/zebra/zebra_vxlan.c
+++ b/zebra/zebra_vxlan.c
@@ -2913,7 +2913,7 @@ static int zl3vni_rmac_del(zebra_l3vni_t *zl3vni,
zebra_mac_t *tmp_rmac;
if (zrmac->host_list)
- list_delete(zrmac->host_list);
+ list_delete_and_null(&zrmac->host_list);
zrmac->host_list = NULL;
tmp_rmac = hash_release(zl3vni->rmac_table, zrmac);
@@ -3102,7 +3102,7 @@ static int zl3vni_nh_del(zebra_l3vni_t *zl3vni,
zebra_neigh_t *tmp_n;
if (n->host_list)
- list_delete(n->host_list);
+ list_delete_and_null(&n->host_list);
n->host_list = NULL;
tmp_n = hash_release(zl3vni->nh_table, n);