From 40424548910887f3bbbf544ce964d3b736048ae5 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Mon, 28 Oct 2019 12:02:17 +0100 Subject: [PATCH] zebra: local mac entries populated in correct netnamespace MAC address neighbours are read on the same netnamespace where the vxlan interface is. Signed-off-by: Philippe Guibert --- zebra/zebra_vxlan.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 6a4c01bd5b..4d2dc85b76 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -3987,6 +3987,7 @@ static void zvni_deref_ip2mac(zebra_vni_t *zvni, zebra_mac_t *mac) static void zvni_read_mac_neigh(zebra_vni_t *zvni, struct interface *ifp) { struct zebra_ns *zns; + struct zebra_vrf *zvrf; struct zebra_if *zif; struct interface *vlan_if; struct zebra_l2info_vxlan *vxl; @@ -3994,7 +3995,10 @@ static void zvni_read_mac_neigh(zebra_vni_t *zvni, struct interface *ifp) zif = ifp->info; vxl = &zif->l2info.vxl; - zns = zebra_ns_lookup(NS_DEFAULT); + zvrf = zebra_vrf_lookup_by_id(zvni->vrf_id); + if (!zvrf || !zvrf->zns) + return; + zns = zvrf->zns; if (IS_ZEBRA_DEBUG_VXLAN) zlog_debug( -- 2.39.5