From 297a21b66b885710f752a2fd42d2fa66db854259 Mon Sep 17 00:00:00 2001 From: Mitesh Kanjariya Date: Wed, 12 Jul 2017 14:09:36 -0700 Subject: [PATCH] zebra: zebra should not try and advertise gateway macip if EVPN is disabled Ticket: CM-17050 Review: CCR-6447 Unit-test: Manual Signed-off-by: Mitesh Kanjariya --- zebra/zebra_vxlan.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 52886bd7f0..f99c16ae91 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -3820,6 +3820,13 @@ int zebra_vxlan_add_del_gw_macip(struct interface *ifp, struct prefix *p, memset(&ip, 0, sizeof(struct ipaddr)); memset(&macaddr, 0, sizeof(struct ethaddr)); + zvrf = vrf_info_lookup(ifp->vrf_id); + if (!zvrf) + return -1; + + if (!EVPN_ENABLED(zvrf)) + return 0; + if (IS_ZEBRA_IF_MACVLAN(ifp)) { struct interface *svi_if = NULL; /* SVI corresponding to the MACVLAN */ @@ -3866,9 +3873,6 @@ int zebra_vxlan_add_del_gw_macip(struct interface *ifp, struct prefix *p, return -1; } - zvrf = vrf_info_lookup(zvni->vxlan_if->vrf_id); - if (!zvrf) - return -1; /* check if we are advertising gw macip routes */ if (!advertise_gw_macip_enabled(zvrf, zvni)) -- 2.39.5