summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-03-21 13:04:25 +0200
committerGitHub <noreply@github.com>2023-03-21 13:04:25 +0200
commit0c462d6c88ad255139d71792f9ff1856c531cab9 (patch)
treeed052320793e2a8e4ab11f57dcac7c8899b97245
parent7c8478ed285594a5c477d1596ff6e6215ab9a61f (diff)
parent7eefea98ba5d42dc3f042b509fe0f18a0e1d5548 (diff)
Merge pull request #13062 from Pdoijode/evpn-use-after-free-fix
zebra: Fix for heap-use-after-free in EVPN
-rw-r--r--zebra/zebra_netns_notify.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c
index cdba0c21ab..28f3c03abe 100644
--- a/zebra/zebra_netns_notify.c
+++ b/zebra/zebra_netns_notify.c
@@ -165,6 +165,17 @@ static int zebra_ns_delete(char *name)
if_down(ifp);
}
+ if (IS_ZEBRA_IF_BOND(ifp))
+ zebra_l2if_update_bond(ifp, false);
+ if (IS_ZEBRA_IF_BOND_SLAVE(ifp))
+ zebra_l2if_update_bond_slave(ifp, IFINDEX_INTERNAL,
+ false);
+ /* Special handling for bridge or VxLAN interfaces. */
+ if (IS_ZEBRA_IF_BRIDGE(ifp))
+ zebra_l2_bridge_del(ifp);
+ else if (IS_ZEBRA_IF_VXLAN(ifp))
+ zebra_l2_vxlanif_del(ifp);
+
UNSET_FLAG(ifp->flags, IFF_UP);
if_delete_update(&ifp);
}