summaryrefslogtreecommitdiff
path: root/zebra/zebra_evpn.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_evpn.c')
-rw-r--r--zebra/zebra_evpn.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/zebra/zebra_evpn.c b/zebra/zebra_evpn.c
index d5e043eea8..13b9cc2002 100644
--- a/zebra/zebra_evpn.c
+++ b/zebra/zebra_evpn.c
@@ -152,12 +152,10 @@ void zebra_evpn_print(struct zebra_evpn *zevpn, void **ctxt)
json_object_int_add(json, "sviIfindex",
zevpn->svi_if->ifindex);
}
- json_object_string_add(json, "vtepIp",
- inet_ntop(AF_INET, &zevpn->local_vtep_ip,
- buf, sizeof(buf)));
- json_object_string_add(json, "mcastGroup",
- inet_ntop(AF_INET, &zevpn->mcast_grp,
- buf, sizeof(buf)));
+ json_object_string_addf(json, "vtepIp", "%pI4",
+ &zevpn->local_vtep_ip);
+ json_object_string_addf(json, "mcastGroup", "%pI4",
+ &zevpn->mcast_grp);
json_object_string_add(json, "advertiseGatewayMacip",
zevpn->advertise_gw_macip ? "Yes" : "No");
json_object_string_add(json, "advertiseSviMacip",
@@ -419,10 +417,10 @@ int zebra_evpn_advertise_subnet(struct zebra_evpn *zevpn, struct interface *ifp,
apply_mask(&p);
if (advertise)
- ip_prefix_send_to_client(ifp->vrf_id, &p,
+ ip_prefix_send_to_client(ifp->vrf->vrf_id, &p,
ZEBRA_IP_PREFIX_ROUTE_ADD);
else
- ip_prefix_send_to_client(ifp->vrf_id, &p,
+ ip_prefix_send_to_client(ifp->vrf->vrf_id, &p,
ZEBRA_IP_PREFIX_ROUTE_DEL);
}
return 0;
@@ -483,7 +481,7 @@ int zebra_evpn_gw_macip_del(struct interface *ifp, struct zebra_evpn *zevpn,
if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug(
"%u:SVI %s(%u) VNI %u, sending GW MAC %pEA IP %pIA del to BGP",
- ifp->vrf_id, ifp->name, ifp->ifindex, zevpn->vni,
+ ifp->vrf->vrf_id, ifp->name, ifp->ifindex, zevpn->vni,
&n->emac, ip);
/* Remove neighbor from BGP. */
@@ -1423,8 +1421,24 @@ void zebra_evpn_rem_macip_add(vni_t vni, const struct ethaddr *macaddr,
* REMOTE - if ES is not local
*/
if (flags & ZEBRA_MACIP_TYPE_SYNC_PATH) {
- zebra_evpn_process_sync_macip_add(zevpn, macaddr, ipa_len,
- ipaddr, flags, seq, esi);
+ struct zebra_evpn_es *es;
+
+ es = zebra_evpn_es_find(esi);
+ if (es && (es->flags & ZEBRA_EVPNES_READY_FOR_BGP)) {
+ zebra_evpn_process_sync_macip_add(zevpn, macaddr,
+ ipa_len, ipaddr,
+ flags, seq, esi);
+ } else {
+ if (IS_ZEBRA_DEBUG_EVPN_MH_ES) {
+ char esi_str[ESI_STR_LEN];
+
+ esi_to_str(esi, esi_str, sizeof(esi_str));
+ zlog_debug(
+ "Ignore sync-macip add; ES %s is not ready",
+ esi_str);
+ }
+ }
+
return;
}
@@ -1517,7 +1531,7 @@ void zebra_evpn_rem_macip_del(vni_t vni, const struct ethaddr *macaddr,
if (!mac && !n)
return;
- zvrf = vrf_info_lookup(zevpn->vxlan_if->vrf_id);
+ zvrf = zevpn->vxlan_if->vrf->info;
/* Ignore the delete if this mac is a gateway mac-ip */
if (CHECK_FLAG(mac->flags, ZEBRA_MAC_LOCAL)