Merge pull request #4806 from chiragshah6/evpn_dev1

zebra: fix advertise svi ip as macip route
This commit is contained in:
Russ White 2019-08-09 07:32:57 -04:00 committed by GitHub
commit fbae9087cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2787,27 +2787,40 @@ static int zvni_gw_macip_add(struct interface *ifp, zebra_vni_t *zvni,
/* Set "local" forwarding info. */ /* Set "local" forwarding info. */
SET_FLAG(n->flags, ZEBRA_NEIGH_LOCAL); SET_FLAG(n->flags, ZEBRA_NEIGH_LOCAL);
SET_FLAG(n->flags, ZEBRA_NEIGH_DEF_GW);
ZEBRA_NEIGH_SET_ACTIVE(n); ZEBRA_NEIGH_SET_ACTIVE(n);
/* Set Router flag (R-bit) */
if (ip->ipa_type == IPADDR_V6)
SET_FLAG(n->flags, ZEBRA_NEIGH_ROUTER_FLAG);
memcpy(&n->emac, macaddr, ETH_ALEN); memcpy(&n->emac, macaddr, ETH_ALEN);
n->ifindex = ifp->ifindex; n->ifindex = ifp->ifindex;
/* Only advertise in BGP if the knob is enabled */ /* Only advertise in BGP if the knob is enabled */
if (!advertise_gw_macip_enabled(zvni)) if (advertise_gw_macip_enabled(zvni)) {
return 0;
if (IS_ZEBRA_DEBUG_VXLAN) SET_FLAG(mac->flags, ZEBRA_MAC_DEF_GW);
zlog_debug( SET_FLAG(n->flags, ZEBRA_NEIGH_DEF_GW);
/* Set Router flag (R-bit) */
if (ip->ipa_type == IPADDR_V6)
SET_FLAG(n->flags, ZEBRA_NEIGH_ROUTER_FLAG);
if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug(
"SVI %s(%u) L2-VNI %u, sending GW MAC %s IP %s add to BGP with flags 0x%x", "SVI %s(%u) L2-VNI %u, sending GW MAC %s IP %s add to BGP with flags 0x%x",
ifp->name, ifp->ifindex, zvni->vni, ifp->name, ifp->ifindex, zvni->vni,
prefix_mac2str(macaddr, buf, sizeof(buf)), prefix_mac2str(macaddr, buf, sizeof(buf)),
ipaddr2str(ip, buf2, sizeof(buf2)), n->flags); ipaddr2str(ip, buf2, sizeof(buf2)), n->flags);
zvni_neigh_send_add_to_client(zvni->vni, ip, macaddr, zvni_neigh_send_add_to_client(zvni->vni, ip, macaddr,
n->flags, n->loc_seq); n->flags, n->loc_seq);
} else if (advertise_svi_macip_enabled(zvni)) {
if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug(
"SVI %s(%u) L2-VNI %u, sending SVI MAC %s IP %s add to BGP with flags 0x%x",
ifp->name, ifp->ifindex, zvni->vni,
prefix_mac2str(macaddr, buf, sizeof(buf)),
ipaddr2str(ip, buf2, sizeof(buf2)), n->flags);
zvni_neigh_send_add_to_client(zvni->vni, ip, macaddr,
n->flags, n->loc_seq);
}
return 0; return 0;
} }
@ -9015,7 +9028,7 @@ void zebra_vxlan_advertise_svi_macip(ZAPI_HANDLER_ARGS)
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug("EVPN SVI-MACIP Adv %s, currently %s", zlog_debug("EVPN SVI-MACIP Adv %s, currently %s",
advertise ? "enabled" : "disabled", advertise ? "enabled" : "disabled",
advertise_gw_macip_enabled(NULL) advertise_svi_macip_enabled(NULL)
? "enabled" ? "enabled"
: "disabled"); : "disabled");