]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: zebra should not try and advertise gateway macip if EVPN is disabled
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Wed, 12 Jul 2017 21:09:36 +0000 (14:09 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 8 Aug 2017 14:28:54 +0000 (10:28 -0400)
Ticket: CM-17050
Review: CCR-6447
Unit-test: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
zebra/zebra_vxlan.c

index 52886bd7f0e2da906ac8cc54704cd6fbb8573d9a..f99c16ae91a8586a9a256fefab5a2a94f328275d 100644 (file)
@@ -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))