zebra: use printfrr exts in EVPN/VXLAN code

Signed-off-by: David Lamparter <equinox@diac24.net>
This commit is contained in:
David Lamparter 2021-03-12 02:44:45 +01:00
parent 5e9f9adbb4
commit ef7b8be459
7 changed files with 213 additions and 467 deletions

View file

@ -2839,7 +2839,6 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
vlanid_t vid = 0; vlanid_t vid = 0;
struct in_addr vtep_ip; struct in_addr vtep_ip;
int vid_present = 0, dst_present = 0; int vid_present = 0, dst_present = 0;
char buf[ETHER_ADDR_STRLEN];
char vid_buf[20]; char vid_buf[20];
char dst_buf[30]; char dst_buf[30];
bool sticky; bool sticky;
@ -2918,11 +2917,10 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
} }
if (IS_ZEBRA_DEBUG_KERNEL) if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug("Rx %s AF_BRIDGE IF %u%s st 0x%x fl 0x%x MAC %s%s nhg %d", zlog_debug("Rx %s AF_BRIDGE IF %u%s st 0x%x fl 0x%x MAC %pEA%s nhg %d",
nl_msg_type_to_str(h->nlmsg_type), nl_msg_type_to_str(h->nlmsg_type),
ndm->ndm_ifindex, vid_present ? vid_buf : "", ndm->ndm_ifindex, vid_present ? vid_buf : "",
ndm->ndm_state, ndm->ndm_flags, ndm->ndm_state, ndm->ndm_flags, &mac,
prefix_mac2str(&mac, buf, sizeof(buf)),
dst_present ? dst_buf : "", nhg_id); dst_present ? dst_buf : "", nhg_id);
/* The interface should exist. */ /* The interface should exist. */
@ -3123,7 +3121,6 @@ static int netlink_request_specific_mac_in_bridge(struct zebra_ns *zns,
char buf[256]; char buf[256];
} req; } req;
struct zebra_if *br_zif; struct zebra_if *br_zif;
char buf[ETHER_ADDR_STRLEN];
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ndmsg)); req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ndmsg));
@ -3142,11 +3139,10 @@ static int netlink_request_specific_mac_in_bridge(struct zebra_ns *zns,
if (IS_ZEBRA_DEBUG_KERNEL) if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug( zlog_debug(
"%s: Tx family %s IF %s(%u) vrf %s(%u) MAC %s vid %u", "%s: Tx family %s IF %s(%u) vrf %s(%u) MAC %pEA vid %u",
__func__, nl_family_to_str(req.ndm.ndm_family), __func__, nl_family_to_str(req.ndm.ndm_family),
br_if->name, br_if->ifindex, br_if->name, br_if->ifindex,
vrf_id_to_name(br_if->vrf_id), br_if->vrf_id, vrf_id_to_name(br_if->vrf_id), br_if->vrf_id, mac, vid);
prefix_mac2str(mac, buf, sizeof(buf)), vid);
return netlink_request(&zns->netlink_cmd, &req); return netlink_request(&zns->netlink_cmd, &req);
} }
@ -3231,8 +3227,6 @@ ssize_t netlink_macfdb_update_ctx(struct zebra_dplane_ctx *ctx, void *data,
SET_IPADDR_V4(&vtep_ip); SET_IPADDR_V4(&vtep_ip);
if (IS_ZEBRA_DEBUG_KERNEL) { if (IS_ZEBRA_DEBUG_KERNEL) {
char ipbuf[PREFIX_STRLEN];
char buf[ETHER_ADDR_STRLEN];
char vid_buf[20]; char vid_buf[20];
const struct ethaddr *mac = dplane_ctx_mac_get_addr(ctx); const struct ethaddr *mac = dplane_ctx_mac_get_addr(ctx);
@ -3243,12 +3237,11 @@ ssize_t netlink_macfdb_update_ctx(struct zebra_dplane_ctx *ctx, void *data,
vid_buf[0] = '\0'; vid_buf[0] = '\0';
zlog_debug( zlog_debug(
"Tx %s family %s IF %s(%u)%s %sMAC %s dst %s nhg %u%s%s%s%s%s", "Tx %s family %s IF %s(%u)%s %sMAC %pEA dst %pIA nhg %u%s%s%s%s%s",
nl_msg_type_to_str(cmd), nl_family_to_str(AF_BRIDGE), nl_msg_type_to_str(cmd), nl_family_to_str(AF_BRIDGE),
dplane_ctx_get_ifname(ctx), dplane_ctx_get_ifindex(ctx), dplane_ctx_get_ifname(ctx), dplane_ctx_get_ifindex(ctx),
vid_buf, dplane_ctx_mac_is_sticky(ctx) ? "sticky " : "", vid_buf, dplane_ctx_mac_is_sticky(ctx) ? "sticky " : "",
prefix_mac2str(mac, buf, sizeof(buf)), mac, &vtep_ip, nhg_id,
ipaddr2str(&vtep_ip, ipbuf, sizeof(ipbuf)), nhg_id,
(update_flags & DPLANE_MAC_REMOTE) ? " rem" : "", (update_flags & DPLANE_MAC_REMOTE) ? " rem" : "",
(update_flags & DPLANE_MAC_WAS_STATIC) ? " clr_sync" (update_flags & DPLANE_MAC_WAS_STATIC) ? " clr_sync"
: "", : "",
@ -3309,7 +3302,6 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
struct ipaddr ip; struct ipaddr ip;
struct vrf *vrf; struct vrf *vrf;
char buf[ETHER_ADDR_STRLEN]; char buf[ETHER_ADDR_STRLEN];
char buf2[INET6_ADDRSTRLEN];
int mac_present = 0; int mac_present = 0;
bool is_ext; bool is_ext;
bool is_router; bool is_router;
@ -3415,11 +3407,11 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
if (IS_ZEBRA_DEBUG_KERNEL) if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug( zlog_debug(
"Rx %s family %s IF %s(%u) vrf %s(%u) IP %s MAC %s state 0x%x flags 0x%x ext_flags 0x%x", "Rx %s family %s IF %s(%u) vrf %s(%u) IP %pIA MAC %s state 0x%x flags 0x%x ext_flags 0x%x",
nl_msg_type_to_str(h->nlmsg_type), nl_msg_type_to_str(h->nlmsg_type),
nl_family_to_str(ndm->ndm_family), ifp->name, nl_family_to_str(ndm->ndm_family), ifp->name,
ndm->ndm_ifindex, VRF_LOGNAME(vrf), ifp->vrf_id, ndm->ndm_ifindex, VRF_LOGNAME(vrf), ifp->vrf_id,
ipaddr2str(&ip, buf2, sizeof(buf2)), &ip,
mac_present mac_present
? prefix_mac2str(&mac, buf, sizeof(buf)) ? prefix_mac2str(&mac, buf, sizeof(buf))
: "", : "",
@ -3451,11 +3443,11 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
} }
if (IS_ZEBRA_DEBUG_KERNEL) if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug("Rx %s family %s IF %s(%u) vrf %s(%u) IP %s", zlog_debug("Rx %s family %s IF %s(%u) vrf %s(%u) IP %pIA",
nl_msg_type_to_str(h->nlmsg_type), nl_msg_type_to_str(h->nlmsg_type),
nl_family_to_str(ndm->ndm_family), ifp->name, nl_family_to_str(ndm->ndm_family), ifp->name,
ndm->ndm_ifindex, VRF_LOGNAME(vrf), ifp->vrf_id, ndm->ndm_ifindex, VRF_LOGNAME(vrf), ifp->vrf_id,
ipaddr2str(&ip, buf2, sizeof(buf2))); &ip);
/* Process the delete - it may result in re-adding the neighbor if it is /* Process the delete - it may result in re-adding the neighbor if it is
* a valid "remote" neighbor. * a valid "remote" neighbor.
@ -3582,14 +3574,11 @@ static int netlink_request_specific_neigh_in_vlan(struct zebra_ns *zns,
nl_attr_put(&req.n, sizeof(req), NDA_DST, &ip->ip.addr, ipa_len); nl_attr_put(&req.n, sizeof(req), NDA_DST, &ip->ip.addr, ipa_len);
if (IS_ZEBRA_DEBUG_KERNEL) { if (IS_ZEBRA_DEBUG_KERNEL)
char buf[INET6_ADDRSTRLEN]; zlog_debug("%s: Tx %s family %s IF %u IP %pIA flags 0x%x",
zlog_debug("%s: Tx %s family %s IF %u IP %s flags 0x%x",
__func__, nl_msg_type_to_str(type), __func__, nl_msg_type_to_str(type),
nl_family_to_str(req.ndm.ndm_family), ifindex, nl_family_to_str(req.ndm.ndm_family), ifindex, ip,
ipaddr2str(ip, buf, sizeof(buf)), req.n.nlmsg_flags); req.n.nlmsg_flags);
}
return netlink_request(&zns->netlink_cmd, &req); return netlink_request(&zns->netlink_cmd, &req);
} }
@ -3600,7 +3589,6 @@ int netlink_neigh_read_specific_ip(struct ipaddr *ip,
int ret = 0; int ret = 0;
struct zebra_ns *zns; struct zebra_ns *zns;
struct zebra_vrf *zvrf = zebra_vrf_lookup_by_id(vlan_if->vrf_id); struct zebra_vrf *zvrf = zebra_vrf_lookup_by_id(vlan_if->vrf_id);
char buf[INET6_ADDRSTRLEN];
struct zebra_dplane_info dp_info; struct zebra_dplane_info dp_info;
zns = zvrf->zns; zns = zvrf->zns;
@ -3608,9 +3596,8 @@ int netlink_neigh_read_specific_ip(struct ipaddr *ip,
zebra_dplane_info_from_zns(&dp_info, zns, true /*is_cmd*/); zebra_dplane_info_from_zns(&dp_info, zns, true /*is_cmd*/);
if (IS_ZEBRA_DEBUG_KERNEL) if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug("%s: neigh request IF %s(%u) IP %s vrf %s(%u)", zlog_debug("%s: neigh request IF %s(%u) IP %pIA vrf %s(%u)",
__func__, vlan_if->name, vlan_if->ifindex, __func__, vlan_if->name, vlan_if->ifindex, ip,
ipaddr2str(ip, buf, sizeof(buf)),
vrf_id_to_name(vlan_if->vrf_id), vlan_if->vrf_id); vrf_id_to_name(vlan_if->vrf_id), vlan_if->vrf_id);
ret = netlink_request_specific_neigh_in_vlan(zns, RTM_GETNEIGH, ip, ret = netlink_request_specific_neigh_in_vlan(zns, RTM_GETNEIGH, ip,
@ -3702,18 +3689,12 @@ static ssize_t netlink_neigh_update_ctx(const struct zebra_dplane_ctx *ctx,
if (update_flags & DPLANE_NEIGH_SET_STATIC) if (update_flags & DPLANE_NEIGH_SET_STATIC)
ext_flags |= NTF_E_MH_PEER_SYNC; ext_flags |= NTF_E_MH_PEER_SYNC;
} }
if (IS_ZEBRA_DEBUG_KERNEL) { if (IS_ZEBRA_DEBUG_KERNEL)
char buf[INET6_ADDRSTRLEN];
char buf2[ETHER_ADDR_STRLEN];
zlog_debug( zlog_debug(
"Tx %s family %s IF %s(%u) Neigh %s MAC %s flags 0x%x state 0x%x %sext_flags 0x%x", "Tx %s family %s IF %s(%u) Neigh %pIA MAC %pEA flags 0x%x state 0x%x %sext_flags 0x%x",
nl_msg_type_to_str(cmd), nl_family_to_str(family), nl_msg_type_to_str(cmd), nl_family_to_str(family),
dplane_ctx_get_ifname(ctx), dplane_ctx_get_ifindex(ctx), dplane_ctx_get_ifname(ctx), dplane_ctx_get_ifindex(ctx),
ipaddr2str(ip, buf, sizeof(buf)), ip, mac, flags, state, ext ? "ext " : "", ext_flags);
mac ? prefix_mac2str(mac, buf2, sizeof(buf2)) : "null",
flags, state, ext ? "ext " : "", ext_flags);
}
return netlink_neigh_update_msg_encode( return netlink_neigh_update_msg_encode(
ctx, cmd, mac, ip, true, family, RTN_UNICAST, flags, state, ctx, cmd, mac, ip, true, family, RTN_UNICAST, flags, state,

View file

@ -3539,15 +3539,9 @@ mac_update_common(enum dplane_op_e op,
int ret; int ret;
struct zebra_dplane_ctx *ctx = NULL; struct zebra_dplane_ctx *ctx = NULL;
if (IS_ZEBRA_DEBUG_DPLANE_DETAIL) { if (IS_ZEBRA_DEBUG_DPLANE_DETAIL)
char buf1[ETHER_ADDR_STRLEN], buf2[PREFIX_STRLEN]; zlog_debug("init mac ctx %s: mac %pEA, ifp %s, vtep %pI4",
dplane_op2str(op), mac, ifp->name, &vtep_ip);
zlog_debug("init mac ctx %s: mac %s, ifp %s, vtep %s",
dplane_op2str(op),
prefix_mac2str(mac, buf1, sizeof(buf1)),
ifp->name,
inet_ntop(AF_INET, &vtep_ip, buf2, sizeof(buf2)));
}
ctx = dplane_ctx_alloc(); ctx = dplane_ctx_alloc();
ctx->zd_op = op; ctx->zd_op = op;
@ -3725,14 +3719,9 @@ neigh_update_internal(enum dplane_op_e op,
struct zebra_dplane_ctx *ctx = NULL; struct zebra_dplane_ctx *ctx = NULL;
struct zebra_ns *zns; struct zebra_ns *zns;
if (IS_ZEBRA_DEBUG_DPLANE_DETAIL) { if (IS_ZEBRA_DEBUG_DPLANE_DETAIL)
char buf1[ETHER_ADDR_STRLEN], buf2[PREFIX_STRLEN]; zlog_debug("init neigh ctx %s: ifp %s, mac %pEA, ip %pIA",
dplane_op2str(op), ifp->name, mac, ip);
zlog_debug("init neigh ctx %s: ifp %s, mac %s, ip %s",
dplane_op2str(op), ifp->name,
prefix_mac2str(mac, buf1, sizeof(buf1)),
ipaddr2str(ip, buf2, sizeof(buf2)));
}
ctx = dplane_ctx_alloc(); ctx = dplane_ctx_alloc();

View file

@ -447,8 +447,6 @@ int zebra_evpn_gw_macip_add(struct interface *ifp, zebra_evpn_t *zevpn,
int zebra_evpn_gw_macip_del(struct interface *ifp, zebra_evpn_t *zevpn, int zebra_evpn_gw_macip_del(struct interface *ifp, zebra_evpn_t *zevpn,
struct ipaddr *ip) struct ipaddr *ip)
{ {
char buf1[ETHER_ADDR_STRLEN];
char buf2[INET6_ADDRSTRLEN];
zebra_neigh_t *n = NULL; zebra_neigh_t *n = NULL;
zebra_mac_t *mac = NULL; zebra_mac_t *mac = NULL;
@ -461,11 +459,8 @@ int zebra_evpn_gw_macip_del(struct interface *ifp, zebra_evpn_t *zevpn,
mac = zebra_evpn_mac_lookup(zevpn, &n->emac); mac = zebra_evpn_mac_lookup(zevpn, &n->emac);
if (!mac) { if (!mac) {
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug("MAC %s doesn't exist for neigh %s on VNI %u", zlog_debug("MAC %pEA doesn't exist for neigh %pIA on VNI %u",
prefix_mac2str(&n->emac, &n->emac, ip, zevpn->vni);
buf1, sizeof(buf1)),
ipaddr2str(ip, buf2, sizeof(buf2)),
zevpn->vni);
return -1; return -1;
} }
@ -476,10 +471,9 @@ int zebra_evpn_gw_macip_del(struct interface *ifp, zebra_evpn_t *zevpn,
/* only need to delete the entry from bgp if we sent it before */ /* only need to delete the entry from bgp if we sent it before */
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"%u:SVI %s(%u) VNI %u, sending GW MAC %s IP %s del to BGP", "%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_id, ifp->name, ifp->ifindex, zevpn->vni,
prefix_mac2str(&(n->emac), buf1, sizeof(buf1)), &n->emac, ip);
ipaddr2str(ip, buf2, sizeof(buf2)));
/* Remove neighbor from BGP. */ /* Remove neighbor from BGP. */
zebra_evpn_neigh_send_del_to_client(zevpn->vni, &n->ip, &n->emac, zebra_evpn_neigh_send_del_to_client(zevpn->vni, &n->ip, &n->emac,
@ -1321,7 +1315,6 @@ zebra_evpn_process_sync_macip_add(zebra_evpn_t *zevpn, struct ethaddr *macaddr,
uint8_t flags, uint32_t seq, esi_t *esi) uint8_t flags, uint32_t seq, esi_t *esi)
{ {
struct sync_mac_ip_ctx ctx; struct sync_mac_ip_ctx ctx;
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN]; char ipbuf[INET6_ADDRSTRLEN];
bool sticky; bool sticky;
bool remote_gw; bool remote_gw;
@ -1334,9 +1327,9 @@ zebra_evpn_process_sync_macip_add(zebra_evpn_t *zevpn, struct ethaddr *macaddr,
if (IS_ZEBRA_DEBUG_VXLAN || IS_ZEBRA_DEBUG_EVPN_MH_NEIGH if (IS_ZEBRA_DEBUG_VXLAN || IS_ZEBRA_DEBUG_EVPN_MH_NEIGH
|| IS_ZEBRA_DEBUG_EVPN_MH_MAC) || IS_ZEBRA_DEBUG_EVPN_MH_MAC)
zlog_debug( zlog_debug(
"Ignore sync-macip vni %u mac %s%s%s%s%s", "Ignore sync-macip vni %u mac %pEA%s%s%s%s",
zevpn->vni, zevpn->vni,
prefix_mac2str(macaddr, macbuf, sizeof(macbuf)), macaddr,
ipa_len ? " IP " : "", ipa_len ? " IP " : "",
ipa_len ? ipaddr2str(ipaddr, ipbuf, ipa_len ? ipaddr2str(ipaddr, ipbuf,
sizeof(ipbuf)) sizeof(ipbuf))
@ -1455,7 +1448,6 @@ void process_remote_macip_del(vni_t vni, struct ethaddr *macaddr,
struct zebra_ns *zns; struct zebra_ns *zns;
struct zebra_l2info_vxlan *vxl; struct zebra_l2info_vxlan *vxl;
struct zebra_vrf *zvrf; struct zebra_vrf *zvrf;
char buf[ETHER_ADDR_STRLEN];
char buf1[INET6_ADDRSTRLEN]; char buf1[INET6_ADDRSTRLEN];
/* Locate EVPN hash entry - expected to exist. */ /* Locate EVPN hash entry - expected to exist. */
@ -1485,9 +1477,8 @@ void process_remote_macip_del(vni_t vni, struct ethaddr *macaddr,
if (n && !mac) { if (n && !mac) {
zlog_warn( zlog_warn(
"Failed to locate MAC %s for neigh %s VNI %u upon remote MACIP DEL", "Failed to locate MAC %pEA for neigh %pIA VNI %u upon remote MACIP DEL",
prefix_mac2str(macaddr, buf, sizeof(buf)), macaddr, ipaddr, vni);
ipaddr2str(ipaddr, buf1, sizeof(buf1)), vni);
return; return;
} }
@ -1503,8 +1494,8 @@ void process_remote_macip_del(vni_t vni, struct ethaddr *macaddr,
if (CHECK_FLAG(mac->flags, ZEBRA_MAC_LOCAL) if (CHECK_FLAG(mac->flags, ZEBRA_MAC_LOCAL)
&& CHECK_FLAG(mac->flags, ZEBRA_MAC_DEF_GW)) { && CHECK_FLAG(mac->flags, ZEBRA_MAC_DEF_GW)) {
zlog_warn( zlog_warn(
"Ignore remote MACIP DEL VNI %u MAC %s%s%s as MAC is already configured as gateway MAC", "Ignore remote MACIP DEL VNI %u MAC %pEA%s%s as MAC is already configured as gateway MAC",
vni, prefix_mac2str(macaddr, buf, sizeof(buf)), vni, macaddr,
ipa_len ? " IP " : "", ipa_len ? " IP " : "",
ipa_len ? ipaddr2str(ipaddr, buf1, sizeof(buf1)) : ""); ipa_len ? ipaddr2str(ipaddr, buf1, sizeof(buf1)) : "");
return; return;
@ -1525,11 +1516,8 @@ void process_remote_macip_del(vni_t vni, struct ethaddr *macaddr,
&& CHECK_FLAG(mac->flags, ZEBRA_MAC_REMOTE)) { && CHECK_FLAG(mac->flags, ZEBRA_MAC_REMOTE)) {
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"%s: MAC %s (flags 0x%x) is remote and duplicate, read kernel for local entry", "%s: MAC %pEA (flags 0x%x) is remote and duplicate, read kernel for local entry",
__func__, __func__, macaddr, mac->flags);
prefix_mac2str(macaddr, buf,
sizeof(buf)),
mac->flags);
macfdb_read_specific_mac(zns, zif->brslave_info.br_if, macfdb_read_specific_mac(zns, zif->brslave_info.br_if,
macaddr, vxl->access_vlan); macaddr, vxl->access_vlan);
} }

View file

@ -384,7 +384,6 @@ static int zebra_evpn_dad_mac_auto_recovery_exp(struct thread *t)
zebra_evpn_t *zevpn = NULL; zebra_evpn_t *zevpn = NULL;
struct listnode *node = NULL; struct listnode *node = NULL;
zebra_neigh_t *nbr = NULL; zebra_neigh_t *nbr = NULL;
char buf[ETHER_ADDR_STRLEN];
mac = THREAD_ARG(t); mac = THREAD_ARG(t);
@ -405,9 +404,8 @@ static int zebra_evpn_dad_mac_auto_recovery_exp(struct thread *t)
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"%s: duplicate addr mac %s flags %slearn count %u host count %u auto recovery expired", "%s: duplicate addr mac %pEA flags %slearn count %u host count %u auto recovery expired",
__func__, __func__, &mac->macaddr,
prefix_mac2str(&mac->macaddr, buf, sizeof(buf)),
zebra_evpn_zebra_mac_flag_dump(mac, mac_buf, zebra_evpn_zebra_mac_flag_dump(mac, mac_buf,
sizeof(mac_buf)), sizeof(mac_buf)),
mac->dad_count, listcount(mac->neigh_list)); mac->dad_count, listcount(mac->neigh_list));
@ -466,8 +464,6 @@ static void zebra_evpn_dup_addr_detect_for_mac(struct zebra_vrf *zvrf,
zebra_neigh_t *nbr; zebra_neigh_t *nbr;
struct listnode *node = NULL; struct listnode *node = NULL;
struct timeval elapsed = {0, 0}; struct timeval elapsed = {0, 0};
char buf[ETHER_ADDR_STRLEN];
char buf1[INET6_ADDRSTRLEN];
bool reset_params = false; bool reset_params = false;
if (!(zebra_evpn_do_dup_addr_detect(zvrf) && do_dad)) if (!(zebra_evpn_do_dup_addr_detect(zvrf) && do_dad))
@ -482,9 +478,8 @@ static void zebra_evpn_dup_addr_detect_for_mac(struct zebra_vrf *zvrf,
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"%s: duplicate addr MAC %s flags %sskip update to client, learn count %u recover time %u", "%s: duplicate addr MAC %pEA flags %sskip update to client, learn count %u recover time %u",
__func__, __func__, &mac->macaddr,
prefix_mac2str(&mac->macaddr, buf, sizeof(buf)),
zebra_evpn_zebra_mac_flag_dump(mac, mac_buf, zebra_evpn_zebra_mac_flag_dump(mac, mac_buf,
sizeof(mac_buf)), sizeof(mac_buf)),
mac->dad_count, zvrf->dad_freeze_time); mac->dad_count, zvrf->dad_freeze_time);
@ -520,9 +515,8 @@ static void zebra_evpn_dup_addr_detect_for_mac(struct zebra_vrf *zvrf,
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"%s: duplicate addr MAC %s flags %sdetection time passed, reset learn count %u", "%s: duplicate addr MAC %pEA flags %sdetection time passed, reset learn count %u",
__func__, __func__, &mac->macaddr,
prefix_mac2str(&mac->macaddr, buf, sizeof(buf)),
zebra_evpn_zebra_mac_flag_dump(mac, mac_buf, zebra_evpn_zebra_mac_flag_dump(mac, mac_buf,
sizeof(mac_buf)), sizeof(mac_buf)),
mac->dad_count); mac->dad_count);
@ -552,9 +546,8 @@ static void zebra_evpn_dup_addr_detect_for_mac(struct zebra_vrf *zvrf,
if (mac->dad_count >= zvrf->dad_max_moves) { if (mac->dad_count >= zvrf->dad_max_moves) {
flog_warn(EC_ZEBRA_DUP_MAC_DETECTED, flog_warn(EC_ZEBRA_DUP_MAC_DETECTED,
"VNI %u: MAC %s detected as duplicate during %s VTEP %pI4", "VNI %u: MAC %pEA detected as duplicate during %s VTEP %pI4",
mac->zevpn->vni, mac->zevpn->vni, &mac->macaddr,
prefix_mac2str(&mac->macaddr, buf, sizeof(buf)),
is_local ? "local update, last" : is_local ? "local update, last" :
"remote update, from", &vtep_ip); "remote update, from", &vtep_ip);
@ -577,11 +570,8 @@ static void zebra_evpn_dup_addr_detect_for_mac(struct zebra_vrf *zvrf,
nbr->dad_dup_detect_time = monotime(NULL); nbr->dad_dup_detect_time = monotime(NULL);
flog_warn(EC_ZEBRA_DUP_IP_INHERIT_DETECTED, flog_warn(EC_ZEBRA_DUP_IP_INHERIT_DETECTED,
"VNI %u: MAC %s IP %s detected as duplicate during %s update, inherit duplicate from MAC", "VNI %u: MAC %pEA IP %pIA detected as duplicate during %s update, inherit duplicate from MAC",
mac->zevpn->vni, mac->zevpn->vni, &mac->macaddr, &nbr->ip,
prefix_mac2str(&mac->macaddr,
buf, sizeof(buf)),
ipaddr2str(&nbr->ip, buf1, sizeof(buf1)),
is_local ? "local" : "remote"); is_local ? "local" : "remote");
} }
@ -592,10 +582,8 @@ static void zebra_evpn_dup_addr_detect_for_mac(struct zebra_vrf *zvrf,
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"%s: duplicate addr MAC %s flags %sauto recovery time %u start", "%s: duplicate addr MAC %pEA flags %sauto recovery time %u start",
__func__, __func__, &mac->macaddr,
prefix_mac2str(&mac->macaddr, buf,
sizeof(buf)),
zebra_evpn_zebra_mac_flag_dump( zebra_evpn_zebra_mac_flag_dump(
mac, mac_buf, sizeof(mac_buf)), mac, mac_buf, sizeof(mac_buf)),
zvrf->dad_freeze_time); zvrf->dad_freeze_time);
@ -1004,8 +992,6 @@ int zebra_evpn_macip_send_msg_to_client(vni_t vni, struct ethaddr *macaddr,
uint32_t seq, int state, uint32_t seq, int state,
struct zebra_evpn_es *es, uint16_t cmd) struct zebra_evpn_es *es, uint16_t cmd)
{ {
char buf[ETHER_ADDR_STRLEN];
char buf2[INET6_ADDRSTRLEN];
int ipa_len; int ipa_len;
struct zserv *client = NULL; struct zserv *client = NULL;
struct stream *s = NULL; struct stream *s = NULL;
@ -1050,12 +1036,11 @@ int zebra_evpn_macip_send_msg_to_client(vni_t vni, struct ethaddr *macaddr,
char flag_buf[MACIP_BUF_SIZE]; char flag_buf[MACIP_BUF_SIZE];
zlog_debug( zlog_debug(
"Send MACIP %s f %s MAC %s IP %s seq %u L2-VNI %u ESI %s to %s", "Send MACIP %s f %s MAC %pEA IP %pIA seq %u L2-VNI %u ESI %s to %s",
(cmd == ZEBRA_MACIP_ADD) ? "Add" : "Del", (cmd == ZEBRA_MACIP_ADD) ? "Add" : "Del",
zclient_evpn_dump_macip_flags(flags, flag_buf, zclient_evpn_dump_macip_flags(flags, flag_buf,
sizeof(flag_buf)), sizeof(flag_buf)),
prefix_mac2str(macaddr, buf, sizeof(buf)), macaddr, ip, seq, vni,
ipaddr2str(ip, buf2, sizeof(buf2)), seq, vni,
es ? es->esi_str : "-", es ? es->esi_str : "-",
zebra_route_string(client->proto)); zebra_route_string(client->proto));
} }
@ -1129,11 +1114,10 @@ zebra_mac_t *zebra_evpn_mac_add(zebra_evpn_t *zevpn, struct ethaddr *macaddr)
mac->uptime = monotime(NULL); mac->uptime = monotime(NULL);
if (IS_ZEBRA_DEBUG_VXLAN || IS_ZEBRA_DEBUG_EVPN_MH_MAC) { if (IS_ZEBRA_DEBUG_VXLAN || IS_ZEBRA_DEBUG_EVPN_MH_MAC) {
char buf[ETHER_ADDR_STRLEN];
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug("%s: MAC %s flags %s", __func__, zlog_debug("%s: MAC %pEA flags %s", __func__,
prefix_mac2str(&mac->macaddr, buf, sizeof(buf)), &mac->macaddr,
zebra_evpn_zebra_mac_flag_dump(mac, mac_buf, zebra_evpn_zebra_mac_flag_dump(mac, mac_buf,
sizeof(mac_buf))); sizeof(mac_buf)));
} }
@ -1148,11 +1132,10 @@ int zebra_evpn_mac_del(zebra_evpn_t *zevpn, zebra_mac_t *mac)
zebra_mac_t *tmp_mac; zebra_mac_t *tmp_mac;
if (IS_ZEBRA_DEBUG_VXLAN || IS_ZEBRA_DEBUG_EVPN_MH_MAC) { if (IS_ZEBRA_DEBUG_VXLAN || IS_ZEBRA_DEBUG_EVPN_MH_MAC) {
char buf[ETHER_ADDR_STRLEN];
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug("%s: MAC %s flags %s", __func__, zlog_debug("%s: MAC %pEA flags %s", __func__,
prefix_mac2str(&mac->macaddr, buf, sizeof(buf)), &mac->macaddr,
zebra_evpn_zebra_mac_flag_dump(mac, mac_buf, zebra_evpn_zebra_mac_flag_dump(mac, mac_buf,
sizeof(mac_buf))); sizeof(mac_buf)));
} }
@ -1201,12 +1184,11 @@ static bool zebra_evpn_check_mac_del_from_db(struct mac_walk_ctx *wctx,
else if ((wctx->flags & DEL_LOCAL_MAC) && (mac->flags & ZEBRA_MAC_AUTO) else if ((wctx->flags & DEL_LOCAL_MAC) && (mac->flags & ZEBRA_MAC_AUTO)
&& !listcount(mac->neigh_list)) { && !listcount(mac->neigh_list)) {
if (IS_ZEBRA_DEBUG_VXLAN) { if (IS_ZEBRA_DEBUG_VXLAN) {
char buf[ETHER_ADDR_STRLEN];
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"%s: Del MAC %s flags %s", __func__, "%s: Del MAC %pEA flags %s", __func__,
prefix_mac2str(&mac->macaddr, buf, sizeof(buf)), &mac->macaddr,
zebra_evpn_zebra_mac_flag_dump( zebra_evpn_zebra_mac_flag_dump(
mac, mac_buf, sizeof(mac_buf))); mac, mac_buf, sizeof(mac_buf)));
} }
@ -1471,7 +1453,6 @@ static int zebra_evpn_mac_hold_exp_cb(struct thread *t)
bool new_bgp_ready; bool new_bgp_ready;
bool old_static; bool old_static;
bool new_static; bool new_static;
char macbuf[ETHER_ADDR_STRLEN];
mac = THREAD_ARG(t); mac = THREAD_ARG(t);
/* the purpose of the hold timer is to age out the peer-active /* the purpose of the hold timer is to age out the peer-active
@ -1490,9 +1471,8 @@ static int zebra_evpn_mac_hold_exp_cb(struct thread *t)
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"sync-mac vni %u mac %s es %s %shold expired", "sync-mac vni %u mac %pEA es %s %shold expired",
mac->zevpn->vni, mac->zevpn->vni, &mac->macaddr,
prefix_mac2str(&mac->macaddr, macbuf, sizeof(macbuf)),
mac->es ? mac->es->esi_str : "-", mac->es ? mac->es->esi_str : "-",
zebra_evpn_zebra_mac_flag_dump(mac, mac_buf, zebra_evpn_zebra_mac_flag_dump(mac, mac_buf,
sizeof(mac_buf))); sizeof(mac_buf)));
@ -1516,8 +1496,6 @@ static int zebra_evpn_mac_hold_exp_cb(struct thread *t)
static inline void zebra_evpn_mac_start_hold_timer(zebra_mac_t *mac) static inline void zebra_evpn_mac_start_hold_timer(zebra_mac_t *mac)
{ {
char macbuf[ETHER_ADDR_STRLEN];
if (mac->hold_timer) if (mac->hold_timer)
return; return;
@ -1525,9 +1503,8 @@ static inline void zebra_evpn_mac_start_hold_timer(zebra_mac_t *mac)
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"sync-mac vni %u mac %s es %s %shold started", "sync-mac vni %u mac %pEA es %s %shold started",
mac->zevpn->vni, mac->zevpn->vni, &mac->macaddr,
prefix_mac2str(&mac->macaddr, macbuf, sizeof(macbuf)),
mac->es ? mac->es->esi_str : "-", mac->es ? mac->es->esi_str : "-",
zebra_evpn_zebra_mac_flag_dump(mac, mac_buf, zebra_evpn_zebra_mac_flag_dump(mac, mac_buf,
sizeof(mac_buf))); sizeof(mac_buf)));
@ -1538,8 +1515,6 @@ static inline void zebra_evpn_mac_start_hold_timer(zebra_mac_t *mac)
void zebra_evpn_mac_stop_hold_timer(zebra_mac_t *mac) void zebra_evpn_mac_stop_hold_timer(zebra_mac_t *mac)
{ {
char macbuf[ETHER_ADDR_STRLEN];
if (!mac->hold_timer) if (!mac->hold_timer)
return; return;
@ -1547,9 +1522,8 @@ void zebra_evpn_mac_stop_hold_timer(zebra_mac_t *mac)
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"sync-mac vni %u mac %s es %s %shold stopped", "sync-mac vni %u mac %pEA es %s %shold stopped",
mac->zevpn->vni, mac->zevpn->vni, &mac->macaddr,
prefix_mac2str(&mac->macaddr, macbuf, sizeof(macbuf)),
mac->es ? mac->es->esi_str : "-", mac->es ? mac->es->esi_str : "-",
zebra_evpn_zebra_mac_flag_dump(mac, mac_buf, zebra_evpn_zebra_mac_flag_dump(mac, mac_buf,
sizeof(mac_buf))); sizeof(mac_buf)));
@ -1560,7 +1534,6 @@ void zebra_evpn_mac_stop_hold_timer(zebra_mac_t *mac)
void zebra_evpn_sync_mac_del(zebra_mac_t *mac) void zebra_evpn_sync_mac_del(zebra_mac_t *mac)
{ {
char macbuf[ETHER_ADDR_STRLEN];
bool old_static; bool old_static;
bool new_static; bool new_static;
@ -1568,9 +1541,8 @@ void zebra_evpn_sync_mac_del(zebra_mac_t *mac)
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"sync-mac del vni %u mac %s es %s seq %d f %s", "sync-mac del vni %u mac %pEA es %s seq %d f %s",
mac->zevpn->vni, mac->zevpn->vni, &mac->macaddr,
prefix_mac2str(&mac->macaddr, macbuf, sizeof(macbuf)),
mac->es ? mac->es->esi_str : "-", mac->loc_seq, mac->es ? mac->es->esi_str : "-", mac->loc_seq,
zebra_evpn_zebra_mac_flag_dump(mac, mac_buf, zebra_evpn_zebra_mac_flag_dump(mac, mac_buf,
sizeof(mac_buf))); sizeof(mac_buf)));
@ -1595,7 +1567,6 @@ static inline bool zebra_evpn_mac_is_bgp_seq_ok(zebra_evpn_t *zevpn,
struct ipaddr *ipaddr, struct ipaddr *ipaddr,
bool sync) bool sync)
{ {
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN]; char ipbuf[INET6_ADDRSTRLEN];
uint32_t tmp_seq; uint32_t tmp_seq;
const char *n_type; const char *n_type;
@ -1620,11 +1591,10 @@ static inline bool zebra_evpn_mac_is_bgp_seq_ok(zebra_evpn_t *zevpn,
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"%s-macip accept vni %u %s-mac %s%s%s lower seq %u f %s", "%s-macip accept vni %u %s-mac %pEA%s%s lower seq %u f %s",
sync ? "sync" : "rem", zevpn->vni, sync ? "sync" : "rem", zevpn->vni,
n_type, n_type,
prefix_mac2str(&mac->macaddr, macbuf, &mac->macaddr,
sizeof(macbuf)),
ipa_len ? " IP " : "", ipa_len ? " IP " : "",
ipa_len ? ipaddr2str(ipaddr, ipbuf, ipa_len ? ipaddr2str(ipaddr, ipbuf,
sizeof(ipbuf)) sizeof(ipbuf))
@ -1641,10 +1611,9 @@ static inline bool zebra_evpn_mac_is_bgp_seq_ok(zebra_evpn_t *zevpn,
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"%s-macip ignore vni %u %s-mac %s%s%s as existing has higher seq %u f %s", "%s-macip ignore vni %u %s-mac %pEA%s%s as existing has higher seq %u f %s",
sync ? "sync" : "rem", zevpn->vni, n_type, sync ? "sync" : "rem", zevpn->vni, n_type,
prefix_mac2str(&mac->macaddr, macbuf, &mac->macaddr,
sizeof(macbuf)),
ipa_len ? " IP " : "", ipa_len ? " IP " : "",
ipa_len ? ipaddr2str(ipaddr, ipbuf, ipa_len ? ipaddr2str(ipaddr, ipbuf,
sizeof(ipbuf)) sizeof(ipbuf))
@ -1671,7 +1640,6 @@ zebra_evpn_proc_sync_mac_update(zebra_evpn_t *zevpn, struct ethaddr *macaddr,
bool seq_change = false; bool seq_change = false;
bool es_change = false; bool es_change = false;
uint32_t tmp_seq; uint32_t tmp_seq;
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN]; char ipbuf[INET6_ADDRSTRLEN];
bool old_local = false; bool old_local = false;
bool old_bgp_ready; bool old_bgp_ready;
@ -1719,10 +1687,8 @@ zebra_evpn_proc_sync_mac_update(zebra_evpn_t *zevpn, struct ethaddr *macaddr,
if (sticky || remote_gw) { if (sticky || remote_gw) {
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug( zlog_debug(
"Ignore sync-macip vni %u mac %s%s%s%s%s", "Ignore sync-macip vni %u mac %pEA%s%s%s%s",
zevpn->vni, zevpn->vni, macaddr,
prefix_mac2str(macaddr, macbuf,
sizeof(macbuf)),
ipa_len ? " IP " : "", ipa_len ? " IP " : "",
ipa_len ? ipaddr2str(ipaddr, ipbuf, ipa_len ? ipaddr2str(ipaddr, ipbuf,
sizeof(ipbuf)) sizeof(ipbuf))
@ -1789,9 +1755,8 @@ zebra_evpn_proc_sync_mac_update(zebra_evpn_t *zevpn, struct ethaddr *macaddr,
omac.flags = old_flags; omac.flags = old_flags;
zlog_debug( zlog_debug(
"sync-mac vni %u mac %s old_f %snew_f %s", "sync-mac vni %u mac %pEA old_f %snew_f %s",
zevpn->vni, zevpn->vni, macaddr,
prefix_mac2str(macaddr, macbuf, sizeof(macbuf)),
zebra_evpn_zebra_mac_flag_dump( zebra_evpn_zebra_mac_flag_dump(
&omac, omac_buf, sizeof(omac_buf)), &omac, omac_buf, sizeof(omac_buf)),
zebra_evpn_zebra_mac_flag_dump( zebra_evpn_zebra_mac_flag_dump(
@ -1834,9 +1799,9 @@ zebra_evpn_proc_sync_mac_update(zebra_evpn_t *zevpn, struct ethaddr *macaddr,
if (IS_ZEBRA_DEBUG_EVPN_MH_MAC) { if (IS_ZEBRA_DEBUG_EVPN_MH_MAC) {
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug("sync-mac %s vni %u mac %s es %s seq %d f %s%s%s", zlog_debug("sync-mac %s vni %u mac %pEA es %s seq %d f %s%s%s",
ctx->mac_created ? "created" : "updated", zevpn->vni, ctx->mac_created ? "created" : "updated",
prefix_mac2str(macaddr, macbuf, sizeof(macbuf)), zevpn->vni, macaddr,
mac->es ? mac->es->esi_str : "-", mac->loc_seq, mac->es ? mac->es->esi_str : "-", mac->loc_seq,
zebra_evpn_zebra_mac_flag_dump(mac, mac_buf, zebra_evpn_zebra_mac_flag_dump(mac, mac_buf,
sizeof(mac_buf)), sizeof(mac_buf)),
@ -2000,7 +1965,6 @@ int process_mac_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf,
struct in_addr vtep_ip, uint8_t flags, struct in_addr vtep_ip, uint8_t flags,
uint32_t seq, esi_t *esi) uint32_t seq, esi_t *esi)
{ {
char buf[ETHER_ADDR_STRLEN];
char buf1[INET6_ADDRSTRLEN]; char buf1[INET6_ADDRSTRLEN];
bool sticky; bool sticky;
bool remote_gw; bool remote_gw;
@ -2023,9 +1987,8 @@ int process_mac_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf,
&& CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_GW)) { && CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_GW)) {
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"Ignore remote MACIP ADD VNI %u MAC %s%s%s as MAC is already configured as gateway MAC", "Ignore remote MACIP ADD VNI %u MAC %pEA%s%s as MAC is already configured as gateway MAC",
zevpn->vni, zevpn->vni, macaddr,
prefix_mac2str(macaddr, buf, sizeof(buf)),
ipa_len ? " IP " : "", ipa_len ? " IP " : "",
ipa_len ? ipaddr2str(ipaddr, buf1, sizeof(buf1)) ipa_len ? ipaddr2str(ipaddr, buf1, sizeof(buf1))
: ""); : "");
@ -2050,10 +2013,8 @@ int process_mac_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf,
mac = zebra_evpn_mac_add(zevpn, macaddr); mac = zebra_evpn_mac_add(zevpn, macaddr);
if (!mac) { if (!mac) {
zlog_warn( zlog_warn(
"Failed to add MAC %s VNI %u Remote VTEP %pI4", "Failed to add MAC %pEA VNI %u Remote VTEP %pI4",
prefix_mac2str(macaddr, buf, macaddr, zevpn->vni, &vtep_ip);
sizeof(buf)),
zevpn->vni, &vtep_ip);
return -1; return -1;
} }
@ -2112,10 +2073,8 @@ int process_mac_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf,
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"sync-mac->remote vni %u mac %s es %s seq %d f %s", "sync-mac->remote vni %u mac %pEA es %s seq %d f %s",
zevpn->vni, zevpn->vni, macaddr,
prefix_mac2str(macaddr, buf,
sizeof(buf)),
mac->es ? mac->es->esi_str : "-", mac->es ? mac->es->esi_str : "-",
mac->loc_seq, mac->loc_seq,
zebra_evpn_zebra_mac_flag_dump( zebra_evpn_zebra_mac_flag_dump(
@ -2173,7 +2132,6 @@ int zebra_evpn_add_update_local_mac(struct zebra_vrf *zvrf, zebra_evpn_t *zevpn,
bool sticky, bool local_inactive, bool sticky, bool local_inactive,
bool dp_static, zebra_mac_t *mac) bool dp_static, zebra_mac_t *mac)
{ {
char buf[ETHER_ADDR_STRLEN];
bool mac_sticky = false; bool mac_sticky = false;
bool inform_client = false; bool inform_client = false;
bool upd_neigh = false; bool upd_neigh = false;
@ -2194,9 +2152,8 @@ int zebra_evpn_add_update_local_mac(struct zebra_vrf *zvrf, zebra_evpn_t *zevpn,
if (!mac) { if (!mac) {
if (IS_ZEBRA_DEBUG_VXLAN || IS_ZEBRA_DEBUG_EVPN_MH_MAC) if (IS_ZEBRA_DEBUG_VXLAN || IS_ZEBRA_DEBUG_EVPN_MH_MAC)
zlog_debug( zlog_debug(
"ADD %sMAC %s intf %s(%u) VID %u -> VNI %u%s", "ADD %sMAC %pEA intf %s(%u) VID %u -> VNI %u%s",
sticky ? "sticky " : "", sticky ? "sticky " : "", macaddr,
prefix_mac2str(macaddr, buf, sizeof(buf)),
ifp->name, ifp->ifindex, vid, zevpn->vni, ifp->name, ifp->ifindex, vid, zevpn->vni,
local_inactive ? " local-inactive" : ""); local_inactive ? " local-inactive" : "");
@ -2204,9 +2161,9 @@ int zebra_evpn_add_update_local_mac(struct zebra_vrf *zvrf, zebra_evpn_t *zevpn,
if (!mac) { if (!mac) {
flog_err( flog_err(
EC_ZEBRA_MAC_ADD_FAILED, EC_ZEBRA_MAC_ADD_FAILED,
"Failed to add MAC %s intf %s(%u) VID %u VNI %u", "Failed to add MAC %pEA intf %s(%u) VID %u VNI %u",
prefix_mac2str(macaddr, buf, sizeof(buf)), macaddr, ifp->name, ifp->ifindex, vid,
ifp->name, ifp->ifindex, vid, zevpn->vni); zevpn->vni);
return -1; return -1;
} }
SET_FLAG(mac->flags, ZEBRA_MAC_LOCAL); SET_FLAG(mac->flags, ZEBRA_MAC_LOCAL);
@ -2219,9 +2176,8 @@ int zebra_evpn_add_update_local_mac(struct zebra_vrf *zvrf, zebra_evpn_t *zevpn,
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"UPD %sMAC %s intf %s(%u) VID %u -> VNI %u %scurFlags %s", "UPD %sMAC %pEA intf %s(%u) VID %u -> VNI %u %scurFlags %s",
sticky ? "sticky " : "", sticky ? "sticky " : "", macaddr,
prefix_mac2str(macaddr, buf, sizeof(buf)),
ifp->name, ifp->ifindex, vid, zevpn->vni, ifp->name, ifp->ifindex, vid, zevpn->vni,
local_inactive ? "local-inactive " : "", local_inactive ? "local-inactive " : "",
zebra_evpn_zebra_mac_flag_dump( zebra_evpn_zebra_mac_flag_dump(
@ -2254,13 +2210,11 @@ int zebra_evpn_add_update_local_mac(struct zebra_vrf *zvrf, zebra_evpn_t *zevpn,
&& dp_static == old_static && !es_change) { && dp_static == old_static && !es_change) {
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
" Add/Update %sMAC %s intf %s(%u) VID %u -> VNI %u%s, " " Add/Update %sMAC %pEA intf %s(%u) VID %u -> VNI %u%s, "
"entry exists and has not changed ", "entry exists and has not changed ",
sticky ? "sticky " : "", sticky ? "sticky " : "",
prefix_mac2str(macaddr, buf, macaddr, ifp->name,
sizeof(buf)), ifp->ifindex, vid, zevpn->vni,
ifp->name, ifp->ifindex, vid,
zevpn->vni,
local_inactive local_inactive
? " local_inactive" ? " local_inactive"
: ""); : "");
@ -2315,9 +2269,8 @@ int zebra_evpn_add_update_local_mac(struct zebra_vrf *zvrf, zebra_evpn_t *zevpn,
if (CHECK_FLAG(mac->flags, ZEBRA_MAC_STICKY)) { if (CHECK_FLAG(mac->flags, ZEBRA_MAC_STICKY)) {
flog_warn( flog_warn(
EC_ZEBRA_STICKY_MAC_ALREADY_LEARNT, EC_ZEBRA_STICKY_MAC_ALREADY_LEARNT,
"MAC %s already learnt as remote sticky MAC behind VTEP %pI4 VNI %u", "MAC %pEA already learnt as remote sticky MAC behind VTEP %pI4 VNI %u",
prefix_mac2str(macaddr, buf, macaddr,
sizeof(buf)),
&mac->fwd_info.r_vtep_ip, &mac->fwd_info.r_vtep_ip,
zevpn->vni); zevpn->vni);
return 0; return 0;
@ -2382,9 +2335,8 @@ int zebra_evpn_add_update_local_mac(struct zebra_vrf *zvrf, zebra_evpn_t *zevpn,
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"local mac vni %u mac %s es %s seq %d f %s%s", "local mac vni %u mac %pEA es %s seq %d f %s%s",
zevpn->vni, zevpn->vni, macaddr,
prefix_mac2str(macaddr, buf, sizeof(buf)),
mac->es ? mac->es->esi_str : "", mac->loc_seq, mac->es ? mac->es->esi_str : "", mac->loc_seq,
zebra_evpn_zebra_mac_flag_dump(mac, mac_buf, zebra_evpn_zebra_mac_flag_dump(mac, mac_buf,
sizeof(mac_buf)), sizeof(mac_buf)),
@ -2422,14 +2374,12 @@ int zebra_evpn_add_update_local_mac(struct zebra_vrf *zvrf, zebra_evpn_t *zevpn,
int zebra_evpn_del_local_mac(zebra_evpn_t *zevpn, zebra_mac_t *mac, int zebra_evpn_del_local_mac(zebra_evpn_t *zevpn, zebra_mac_t *mac,
bool clear_static) bool clear_static)
{ {
char buf[ETHER_ADDR_STRLEN];
bool old_bgp_ready; bool old_bgp_ready;
bool new_bgp_ready; bool new_bgp_ready;
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug("DEL MAC %s VNI %u seq %u flags 0x%x nbr count %u", zlog_debug("DEL MAC %pEA VNI %u seq %u flags 0x%x nbr count %u",
prefix_mac2str(&mac->macaddr, buf, sizeof(buf)), &mac->macaddr, zevpn->vni, mac->loc_seq, mac->flags,
zevpn->vni, mac->loc_seq, mac->flags,
listcount(mac->neigh_list)); listcount(mac->neigh_list));
old_bgp_ready = zebra_evpn_mac_is_ready_for_bgp(mac->flags); old_bgp_ready = zebra_evpn_mac_is_ready_for_bgp(mac->flags);
@ -2443,9 +2393,8 @@ int zebra_evpn_del_local_mac(zebra_evpn_t *zevpn, zebra_mac_t *mac,
char mac_buf[MAC_BUF_SIZE]; char mac_buf[MAC_BUF_SIZE];
zlog_debug( zlog_debug(
"re-add sync-mac vni %u mac %s es %s seq %d f %s", "re-add sync-mac vni %u mac %pEA es %s seq %d f %s",
zevpn->vni, zevpn->vni, &mac->macaddr,
prefix_mac2str(&mac->macaddr, buf, sizeof(buf)),
mac->es ? mac->es->esi_str : "-", mac->loc_seq, mac->es ? mac->es->esi_str : "-", mac->loc_seq,
zebra_evpn_zebra_mac_flag_dump( zebra_evpn_zebra_mac_flag_dump(
mac, mac_buf, sizeof(mac_buf))); mac, mac_buf, sizeof(mac_buf)));
@ -2503,7 +2452,6 @@ int zebra_evpn_mac_gw_macip_add(struct interface *ifp, zebra_evpn_t *zevpn,
struct ethaddr *macaddr, vlanid_t vlan_id, struct ethaddr *macaddr, vlanid_t vlan_id,
bool def_gw) bool def_gw)
{ {
char buf[ETHER_ADDR_STRLEN];
zebra_mac_t *mac; zebra_mac_t *mac;
ns_id_t local_ns_id = NS_DEFAULT; ns_id_t local_ns_id = NS_DEFAULT;
struct zebra_vrf *zvrf; struct zebra_vrf *zvrf;
@ -2517,9 +2465,8 @@ int zebra_evpn_mac_gw_macip_add(struct interface *ifp, zebra_evpn_t *zevpn,
mac = zebra_evpn_mac_add(zevpn, macaddr); mac = zebra_evpn_mac_add(zevpn, macaddr);
if (!mac) { if (!mac) {
flog_err(EC_ZEBRA_MAC_ADD_FAILED, flog_err(EC_ZEBRA_MAC_ADD_FAILED,
"Failed to add MAC %s intf %s(%u) VID %u", "Failed to add MAC %pEA intf %s(%u) VID %u",
prefix_mac2str(macaddr, buf, sizeof(buf)), macaddr, ifp->name, ifp->ifindex, vlan_id);
ifp->name, ifp->ifindex, vlan_id);
return -1; return -1;
} }
} }

View file

@ -209,8 +209,6 @@ static void zebra_evpn_local_neigh_ref_mac(zebra_neigh_t *n,
zebra_mac_t *mac, zebra_mac_t *mac,
bool send_mac_update) bool send_mac_update)
{ {
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN];
bool old_static; bool old_static;
bool new_static; bool new_static;
@ -228,11 +226,8 @@ static void zebra_evpn_local_neigh_ref_mac(zebra_neigh_t *n,
new_static = zebra_evpn_mac_is_static(mac); new_static = zebra_evpn_mac_is_static(mac);
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug( zlog_debug(
"sync-neigh ref mac vni %u ip %s mac %s ref %d", "sync-neigh ref mac vni %u ip %pIA mac %pEA ref %d",
n->zevpn->vni, n->zevpn->vni, &n->ip, &n->emac,
ipaddr2str(&n->ip, ipbuf, sizeof(ipbuf)),
prefix_mac2str(&n->emac, macbuf,
sizeof(macbuf)),
mac->sync_neigh_cnt); mac->sync_neigh_cnt);
if ((old_static != new_static) && send_mac_update) if ((old_static != new_static) && send_mac_update)
/* program the local mac in the kernel */ /* program the local mac in the kernel */
@ -248,8 +243,6 @@ static void zebra_evpn_sync_neigh_dp_install(zebra_neigh_t *n,
bool force_clear_static, bool force_clear_static,
const char *caller) const char *caller)
{ {
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN];
struct zebra_ns *zns; struct zebra_ns *zns;
struct interface *ifp; struct interface *ifp;
bool set_static; bool set_static;
@ -260,11 +253,8 @@ static void zebra_evpn_sync_neigh_dp_install(zebra_neigh_t *n,
if (!ifp) { if (!ifp) {
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug( zlog_debug(
"%s: dp-install sync-neigh vni %u ip %s mac %s if %d f 0x%x skipped", "%s: dp-install sync-neigh vni %u ip %pIA mac %pEA if %d f 0x%x skipped",
caller, n->zevpn->vni, caller, n->zevpn->vni, &n->ip, &n->emac,
ipaddr2str(&n->ip, ipbuf, sizeof(ipbuf)),
prefix_mac2str(&n->emac, macbuf,
sizeof(macbuf)),
n->ifindex, n->flags); n->ifindex, n->flags);
return; return;
} }
@ -282,10 +272,8 @@ static void zebra_evpn_sync_neigh_dp_install(zebra_neigh_t *n,
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug( zlog_debug(
"%s: dp-install sync-neigh vni %u ip %s mac %s if %s(%d) f 0x%x%s%s%s", "%s: dp-install sync-neigh vni %u ip %pIA mac %pEA if %s(%d) f 0x%x%s%s%s",
caller, n->zevpn->vni, caller, n->zevpn->vni, &n->ip, &n->emac,
ipaddr2str(&n->ip, ipbuf, sizeof(ipbuf)),
prefix_mac2str(&n->emac, macbuf, sizeof(macbuf)),
ifp->name, n->ifindex, n->flags, ifp->name, n->ifindex, n->flags,
set_router ? " router" : "", set_router ? " router" : "",
set_static ? " static" : "", set_static ? " static" : "",
@ -375,8 +363,6 @@ void zebra_evpn_sync_neigh_static_chg(zebra_neigh_t *n, bool old_n_static,
zebra_mac_t *mac = n->mac; zebra_mac_t *mac = n->mac;
bool old_mac_static; bool old_mac_static;
bool new_mac_static; bool new_mac_static;
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN];
if (old_n_static == new_n_static) if (old_n_static == new_n_static)
return; return;
@ -411,10 +397,9 @@ void zebra_evpn_sync_neigh_static_chg(zebra_neigh_t *n, bool old_n_static,
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug( zlog_debug(
"sync-neigh ref-chg vni %u ip %s mac %s f 0x%x %d%s%s%s%s by %s", "sync-neigh ref-chg vni %u ip %pIA mac %pEA f 0x%x %d%s%s%s%s by %s",
n->zevpn->vni, ipaddr2str(&n->ip, ipbuf, sizeof(ipbuf)), n->zevpn->vni, &n->ip, &n->emac, n->flags,
prefix_mac2str(&n->emac, macbuf, sizeof(macbuf)), mac->sync_neigh_cnt,
n->flags, mac->sync_neigh_cnt,
old_n_static ? " old_n_static" : "", old_n_static ? " old_n_static" : "",
new_n_static ? " new_n_static" : "", new_n_static ? " new_n_static" : "",
old_mac_static ? " old_mac_static" : "", old_mac_static ? " old_mac_static" : "",
@ -434,8 +419,6 @@ static int zebra_evpn_neigh_hold_exp_cb(struct thread *t)
bool new_bgp_ready; bool new_bgp_ready;
bool old_n_static; bool old_n_static;
bool new_n_static; bool new_n_static;
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN];
n = THREAD_ARG(t); n = THREAD_ARG(t);
/* the purpose of the hold timer is to age out the peer-active /* the purpose of the hold timer is to age out the peer-active
@ -451,11 +434,8 @@ static int zebra_evpn_neigh_hold_exp_cb(struct thread *t)
new_n_static = zebra_evpn_neigh_is_static(n); new_n_static = zebra_evpn_neigh_is_static(n);
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug("sync-neigh vni %u ip %s mac %s 0x%x hold expired", zlog_debug("sync-neigh vni %u ip %pIA mac %pEA 0x%x hold expired",
n->zevpn->vni, n->zevpn->vni, &n->ip, &n->emac, n->flags);
ipaddr2str(&n->ip, ipbuf, sizeof(ipbuf)),
prefix_mac2str(&n->emac, macbuf, sizeof(macbuf)),
n->flags);
/* re-program the local neigh in the dataplane if the neigh is no /* re-program the local neigh in the dataplane if the neigh is no
* longer static * longer static
@ -475,18 +455,12 @@ static int zebra_evpn_neigh_hold_exp_cb(struct thread *t)
static inline void zebra_evpn_neigh_start_hold_timer(zebra_neigh_t *n) static inline void zebra_evpn_neigh_start_hold_timer(zebra_neigh_t *n)
{ {
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN];
if (n->hold_timer) if (n->hold_timer)
return; return;
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug("sync-neigh vni %u ip %s mac %s 0x%x hold start", zlog_debug("sync-neigh vni %u ip %pIA mac %pEA 0x%x hold start",
n->zevpn->vni, n->zevpn->vni, &n->ip, &n->emac, n->flags);
ipaddr2str(&n->ip, ipbuf, sizeof(ipbuf)),
prefix_mac2str(&n->emac, macbuf, sizeof(macbuf)),
n->flags);
thread_add_timer(zrouter.master, zebra_evpn_neigh_hold_exp_cb, n, thread_add_timer(zrouter.master, zebra_evpn_neigh_hold_exp_cb, n,
zmh_info->neigh_hold_time, &n->hold_timer); zmh_info->neigh_hold_time, &n->hold_timer);
} }
@ -496,8 +470,6 @@ static void zebra_evpn_local_neigh_deref_mac(zebra_neigh_t *n,
{ {
zebra_mac_t *mac = n->mac; zebra_mac_t *mac = n->mac;
zebra_evpn_t *zevpn = n->zevpn; zebra_evpn_t *zevpn = n->zevpn;
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN];
bool old_static; bool old_static;
bool new_static; bool new_static;
@ -511,11 +483,8 @@ static void zebra_evpn_local_neigh_deref_mac(zebra_neigh_t *n,
new_static = zebra_evpn_mac_is_static(mac); new_static = zebra_evpn_mac_is_static(mac);
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug( zlog_debug(
"sync-neigh deref mac vni %u ip %s mac %s ref %d", "sync-neigh deref mac vni %u ip %pIA mac %pEA ref %d",
n->zevpn->vni, n->zevpn->vni, &n->ip, &n->emac,
ipaddr2str(&n->ip, ipbuf, sizeof(ipbuf)),
prefix_mac2str(&n->emac, macbuf,
sizeof(macbuf)),
mac->sync_neigh_cnt); mac->sync_neigh_cnt);
if ((old_static != new_static) && send_mac_update) if ((old_static != new_static) && send_mac_update)
/* program the local mac in the kernel */ /* program the local mac in the kernel */
@ -532,8 +501,6 @@ bool zebra_evpn_neigh_is_bgp_seq_ok(zebra_evpn_t *zevpn, zebra_neigh_t *n,
struct ethaddr *macaddr, uint32_t seq, struct ethaddr *macaddr, uint32_t seq,
bool sync) bool sync)
{ {
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN];
uint32_t tmp_seq; uint32_t tmp_seq;
const char *n_type; const char *n_type;
@ -555,24 +522,18 @@ bool zebra_evpn_neigh_is_bgp_seq_ok(zebra_evpn_t *zevpn, zebra_neigh_t *n,
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH
|| IS_ZEBRA_DEBUG_VXLAN) || IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"%s-macip accept vni %u %s mac %s IP %s lower seq %u f 0x%x", "%s-macip accept vni %u %s mac %pEA IP %pIA lower seq %u f 0x%x",
sync ? "sync" : "remote", zevpn->vni, sync ? "sync" : "remote", zevpn->vni,
n_type, n_type, macaddr, &n->ip,
prefix_mac2str(macaddr, macbuf,
sizeof(macbuf)),
ipaddr2str(&n->ip, ipbuf,
sizeof(ipbuf)),
tmp_seq, n->flags); tmp_seq, n->flags);
return true; return true;
} }
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH || IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH || IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"%s-macip ignore vni %u %s mac %s IP %s as existing has higher seq %u f 0x%x", "%s-macip ignore vni %u %s mac %pEA IP %pIA as existing has higher seq %u f 0x%x",
sync ? "sync" : "remote", zevpn->vni, n_type, sync ? "sync" : "remote", zevpn->vni, n_type,
prefix_mac2str(macaddr, macbuf, sizeof(macbuf)), macaddr, &n->ip, tmp_seq, n->flags);
ipaddr2str(&n->ip, ipbuf, sizeof(ipbuf)),
tmp_seq, n->flags);
return false; return false;
} }
@ -636,15 +597,10 @@ void zebra_evpn_sync_neigh_del(zebra_neigh_t *n)
{ {
bool old_n_static; bool old_n_static;
bool new_n_static; bool new_n_static;
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN];
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug("sync-neigh del vni %u ip %s mac %s f 0x%x", zlog_debug("sync-neigh del vni %u ip %pIA mac %pEA f 0x%x",
n->zevpn->vni, n->zevpn->vni, &n->ip, &n->emac, n->flags);
ipaddr2str(&n->ip, ipbuf, sizeof(ipbuf)),
prefix_mac2str(&n->emac, macbuf, sizeof(macbuf)),
n->flags);
old_n_static = zebra_evpn_neigh_is_static(n); old_n_static = zebra_evpn_neigh_is_static(n);
UNSET_FLAG(n->flags, ZEBRA_NEIGH_ES_PEER_PROXY); UNSET_FLAG(n->flags, ZEBRA_NEIGH_ES_PEER_PROXY);
@ -676,8 +632,6 @@ zebra_evpn_proc_sync_neigh_update(zebra_evpn_t *zevpn, zebra_neigh_t *n,
bool old_mac_static; bool old_mac_static;
bool new_mac_static; bool new_mac_static;
bool set_dp_inactive = false; bool set_dp_inactive = false;
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN];
bool created; bool created;
ifindex_t ifindex = 0; ifindex_t ifindex = 0;
@ -778,11 +732,8 @@ zebra_evpn_proc_sync_neigh_update(zebra_evpn_t *zevpn, zebra_neigh_t *n,
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH && (old_flags != n->flags)) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH && (old_flags != n->flags))
zlog_debug( zlog_debug(
"sync-neigh vni %u ip %s mac %s old_f 0x%x new_f 0x%x", "sync-neigh vni %u ip %pIA mac %pEA old_f 0x%x new_f 0x%x",
n->zevpn->vni, n->zevpn->vni, &n->ip, &n->emac,
ipaddr2str(&n->ip, ipbuf, sizeof(ipbuf)),
prefix_mac2str(&n->emac, macbuf,
sizeof(macbuf)),
old_flags, n->flags); old_flags, n->flags);
new_n_static = zebra_evpn_neigh_is_static(n); new_n_static = zebra_evpn_neigh_is_static(n);
@ -844,10 +795,9 @@ zebra_evpn_proc_sync_neigh_update(zebra_evpn_t *zevpn, zebra_neigh_t *n,
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug( zlog_debug(
"sync-neigh %s vni %u ip %s mac %s if %s(%d) seq %d f 0x%x%s%s", "sync-neigh %s vni %u ip %pIA mac %pEA if %s(%d) seq %d f 0x%x%s%s",
created ? "created" : "updated", n->zevpn->vni, created ? "created" : "updated", n->zevpn->vni,
ipaddr2str(&n->ip, ipbuf, sizeof(ipbuf)), &n->ip, &n->emac,
prefix_mac2str(&n->emac, macbuf, sizeof(macbuf)),
ifp ? ifp->name : "", ifindex, n->loc_seq, n->flags, ifp ? ifp->name : "", ifindex, n->loc_seq, n->flags,
inform_bgp ? " inform_bgp" : "", inform_bgp ? " inform_bgp" : "",
inform_dataplane ? " inform_dp" : ""); inform_dataplane ? " inform_dp" : "");
@ -970,14 +920,13 @@ void zebra_evpn_process_neigh_on_local_mac_change(zebra_evpn_t *zevpn,
zebra_neigh_t *n = NULL; zebra_neigh_t *n = NULL;
struct listnode *node = NULL; struct listnode *node = NULL;
struct zebra_vrf *zvrf = NULL; struct zebra_vrf *zvrf = NULL;
char buf[ETHER_ADDR_STRLEN];
zvrf = vrf_info_lookup(zevpn->vxlan_if->vrf_id); zvrf = vrf_info_lookup(zevpn->vxlan_if->vrf_id);
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug("Processing neighbors on local MAC %s %s, VNI %u", zlog_debug("Processing neighbors on local MAC %pEA %s, VNI %u",
prefix_mac2str(&zmac->macaddr, buf, sizeof(buf)), &zmac->macaddr, seq_change ? "CHANGE" : "ADD",
seq_change ? "CHANGE" : "ADD", zevpn->vni); zevpn->vni);
/* Walk all neighbors and mark any inactive local neighbors as /* Walk all neighbors and mark any inactive local neighbors as
* active and/or update sequence number upon a move, and inform BGP. * active and/or update sequence number upon a move, and inform BGP.
@ -1012,12 +961,10 @@ void zebra_evpn_process_neigh_on_local_mac_del(zebra_evpn_t *zevpn,
{ {
zebra_neigh_t *n = NULL; zebra_neigh_t *n = NULL;
struct listnode *node = NULL; struct listnode *node = NULL;
char buf[ETHER_ADDR_STRLEN];
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug("Processing neighbors on local MAC %s DEL, VNI %u", zlog_debug("Processing neighbors on local MAC %pEA DEL, VNI %u",
prefix_mac2str(&zmac->macaddr, buf, sizeof(buf)), &zmac->macaddr, zevpn->vni);
zevpn->vni);
/* Walk all local neighbors and mark as inactive and inform /* Walk all local neighbors and mark as inactive and inform
* BGP, if needed. * BGP, if needed.
@ -1047,12 +994,10 @@ void zebra_evpn_process_neigh_on_remote_mac_add(zebra_evpn_t *zevpn,
{ {
zebra_neigh_t *n = NULL; zebra_neigh_t *n = NULL;
struct listnode *node = NULL; struct listnode *node = NULL;
char buf[ETHER_ADDR_STRLEN];
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug("Processing neighbors on remote MAC %s ADD, VNI %u", zlog_debug("Processing neighbors on remote MAC %pEA ADD, VNI %u",
prefix_mac2str(&zmac->macaddr, buf, sizeof(buf)), &zmac->macaddr, zevpn->vni);
zevpn->vni);
/* Walk all local neighbors and mark as inactive and inform /* Walk all local neighbors and mark as inactive and inform
* BGP, if needed. * BGP, if needed.
@ -1085,15 +1030,11 @@ static inline void zebra_evpn_local_neigh_update_log(
bool old_bgp_ready, bool new_bgp_ready, bool inform_dataplane, bool old_bgp_ready, bool new_bgp_ready, bool inform_dataplane,
bool inform_bgp, const char *sfx) bool inform_bgp, const char *sfx)
{ {
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN];
if (!IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (!IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
return; return;
zlog_debug("%s neigh vni %u ip %s mac %s f 0x%x%s%s%s%s%s%s %s", pfx, zlog_debug("%s neigh vni %u ip %pIA mac %pEA f 0x%x%s%s%s%s%s%s %s", pfx,
n->zevpn->vni, ipaddr2str(&n->ip, ipbuf, sizeof(ipbuf)), n->zevpn->vni, &n->ip, &n->emac, n->flags,
prefix_mac2str(&n->emac, macbuf, sizeof(macbuf)), n->flags,
is_router ? " router" : "", is_router ? " router" : "",
local_inactive ? " local-inactive" : "", local_inactive ? " local-inactive" : "",
old_bgp_ready ? " old_bgp_ready" : "", old_bgp_ready ? " old_bgp_ready" : "",
@ -1154,8 +1095,6 @@ static int zebra_evpn_dad_ip_auto_recovery_exp(struct thread *t)
struct zebra_vrf *zvrf = NULL; struct zebra_vrf *zvrf = NULL;
zebra_neigh_t *nbr = NULL; zebra_neigh_t *nbr = NULL;
zebra_evpn_t *zevpn = NULL; zebra_evpn_t *zevpn = NULL;
char buf1[INET6_ADDRSTRLEN];
char buf2[ETHER_ADDR_STRLEN];
nbr = THREAD_ARG(t); nbr = THREAD_ARG(t);
@ -1174,10 +1113,8 @@ static int zebra_evpn_dad_ip_auto_recovery_exp(struct thread *t)
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"%s: duplicate addr MAC %s IP %s flags 0x%x learn count %u vni %u auto recovery expired", "%s: duplicate addr MAC %pEA IP %pIA flags 0x%x learn count %u vni %u auto recovery expired",
__func__, __func__, &nbr->emac, &nbr->ip, nbr->flags,
prefix_mac2str(&nbr->emac, buf2, sizeof(buf2)),
ipaddr2str(&nbr->ip, buf1, sizeof(buf1)), nbr->flags,
nbr->dad_count, zevpn->vni); nbr->dad_count, zevpn->vni);
UNSET_FLAG(nbr->flags, ZEBRA_NEIGH_DUPLICATE); UNSET_FLAG(nbr->flags, ZEBRA_NEIGH_DUPLICATE);
@ -1207,8 +1144,6 @@ zebra_evpn_dup_addr_detect_for_neigh(struct zebra_vrf *zvrf, zebra_neigh_t *nbr,
{ {
struct timeval elapsed = {0, 0}; struct timeval elapsed = {0, 0};
char buf[ETHER_ADDR_STRLEN];
char buf1[INET6_ADDRSTRLEN];
bool reset_params = false; bool reset_params = false;
if (!zebra_evpn_do_dup_addr_detect(zvrf)) if (!zebra_evpn_do_dup_addr_detect(zvrf))
@ -1221,10 +1156,8 @@ zebra_evpn_dup_addr_detect_for_neigh(struct zebra_vrf *zvrf, zebra_neigh_t *nbr,
if (CHECK_FLAG(nbr->flags, ZEBRA_NEIGH_DUPLICATE)) { if (CHECK_FLAG(nbr->flags, ZEBRA_NEIGH_DUPLICATE)) {
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"%s: duplicate addr MAC %s IP %s flags 0x%x skip installing, learn count %u recover time %u", "%s: duplicate addr MAC %pEA IP %pIA flags 0x%x skip installing, learn count %u recover time %u",
__func__, __func__, &nbr->emac, &nbr->ip,
prefix_mac2str(&nbr->emac, buf, sizeof(buf)),
ipaddr2str(&nbr->ip, buf1, sizeof(buf1)),
nbr->flags, nbr->dad_count, nbr->flags, nbr->dad_count,
zvrf->dad_freeze_time); zvrf->dad_freeze_time);
@ -1261,10 +1194,8 @@ zebra_evpn_dup_addr_detect_for_neigh(struct zebra_vrf *zvrf, zebra_neigh_t *nbr,
if (reset_params) { if (reset_params) {
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"%s: duplicate addr MAC %s IP %s flags 0x%x detection time passed, reset learn count %u", "%s: duplicate addr MAC %pEA IP %pIA flags 0x%x detection time passed, reset learn count %u",
__func__, __func__, &nbr->emac, &nbr->ip,
prefix_mac2str(&nbr->emac, buf, sizeof(buf)),
ipaddr2str(&nbr->ip, buf1, sizeof(buf1)),
nbr->flags, nbr->dad_count); nbr->flags, nbr->dad_count);
/* Reset learn count but do not start detection /* Reset learn count but do not start detection
* during REMOTE learn event. * during REMOTE learn event.
@ -1294,10 +1225,8 @@ zebra_evpn_dup_addr_detect_for_neigh(struct zebra_vrf *zvrf, zebra_neigh_t *nbr,
if (nbr->dad_count >= zvrf->dad_max_moves) { if (nbr->dad_count >= zvrf->dad_max_moves) {
flog_warn( flog_warn(
EC_ZEBRA_DUP_IP_DETECTED, EC_ZEBRA_DUP_IP_DETECTED,
"VNI %u: MAC %s IP %s detected as duplicate during %s VTEP %pI4", "VNI %u: MAC %pEA IP %pIA detected as duplicate during %s VTEP %pI4",
nbr->zevpn->vni, nbr->zevpn->vni, &nbr->emac, &nbr->ip,
prefix_mac2str(&nbr->emac, buf, sizeof(buf)),
ipaddr2str(&nbr->ip, buf1, sizeof(buf1)),
is_local ? "local update, last" : "remote update, from", is_local ? "local update, last" : "remote update, from",
&vtep_ip); &vtep_ip);
@ -1311,12 +1240,8 @@ zebra_evpn_dup_addr_detect_for_neigh(struct zebra_vrf *zvrf, zebra_neigh_t *nbr,
if (zvrf->dad_freeze && zvrf->dad_freeze_time) { if (zvrf->dad_freeze && zvrf->dad_freeze_time) {
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"%s: duplicate addr MAC %s IP %s flags 0x%x auto recovery time %u start", "%s: duplicate addr MAC %pEA IP %pIA flags 0x%x auto recovery time %u start",
__func__, __func__, &nbr->emac, &nbr->ip,
prefix_mac2str(&nbr->emac, buf,
sizeof(buf)),
ipaddr2str(&nbr->ip, buf1,
sizeof(buf1)),
nbr->flags, zvrf->dad_freeze_time); nbr->flags, zvrf->dad_freeze_time);
thread_add_timer(zrouter.master, thread_add_timer(zrouter.master,
@ -1334,8 +1259,6 @@ int zebra_evpn_local_neigh_update(zebra_evpn_t *zevpn, struct interface *ifp,
bool is_router, bool local_inactive, bool is_router, bool local_inactive,
bool dp_static) bool dp_static)
{ {
char buf[ETHER_ADDR_STRLEN];
char buf2[INET6_ADDRSTRLEN];
struct zebra_vrf *zvrf; struct zebra_vrf *zvrf;
zebra_neigh_t *n = NULL; zebra_neigh_t *n = NULL;
zebra_mac_t *zmac = NULL, *old_zmac = NULL; zebra_mac_t *zmac = NULL, *old_zmac = NULL;
@ -1357,15 +1280,12 @@ int zebra_evpn_local_neigh_update(zebra_evpn_t *zevpn, struct interface *ifp,
if (!zmac) { if (!zmac) {
/* create a dummy MAC if the MAC is not already present */ /* create a dummy MAC if the MAC is not already present */
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug("AUTO MAC %s created for neigh %s on VNI %u", zlog_debug("AUTO MAC %pEA created for neigh %pIA on VNI %u",
prefix_mac2str(macaddr, buf, sizeof(buf)), macaddr, ip, zevpn->vni);
ipaddr2str(ip, buf2, sizeof(buf2)),
zevpn->vni);
zmac = zebra_evpn_mac_add(zevpn, macaddr); zmac = zebra_evpn_mac_add(zevpn, macaddr);
if (!zmac) { if (!zmac) {
zlog_debug("Failed to add MAC %s VNI %u", zlog_debug("Failed to add MAC %pEA VNI %u", macaddr,
prefix_mac2str(macaddr, buf, sizeof(buf)),
zevpn->vni); zevpn->vni);
return -1; return -1;
} }
@ -1402,10 +1322,9 @@ int zebra_evpn_local_neigh_update(zebra_evpn_t *zevpn, struct interface *ifp,
if (!n) { if (!n) {
flog_err( flog_err(
EC_ZEBRA_MAC_ADD_FAILED, EC_ZEBRA_MAC_ADD_FAILED,
"Failed to add neighbor %s MAC %s intf %s(%u) -> VNI %u", "Failed to add neighbor %pIA MAC %pEA intf %s(%u) -> VNI %u",
ipaddr2str(ip, buf2, sizeof(buf2)), ip, macaddr, ifp->name, ifp->ifindex,
prefix_mac2str(macaddr, buf, sizeof(buf)), zevpn->vni);
ifp->name, ifp->ifindex, zevpn->vni);
return -1; return -1;
} }
/* Set "local" forwarding info. */ /* Set "local" forwarding info. */
@ -1606,9 +1525,8 @@ int zebra_evpn_local_neigh_update(zebra_evpn_t *zevpn, struct interface *ifp,
if (zebra_evpn_ip_inherit_dad_from_mac(zvrf, old_zmac, zmac, n)) { if (zebra_evpn_ip_inherit_dad_from_mac(zvrf, old_zmac, zmac, n)) {
flog_warn( flog_warn(
EC_ZEBRA_DUP_IP_INHERIT_DETECTED, EC_ZEBRA_DUP_IP_INHERIT_DETECTED,
"VNI %u: MAC %s IP %s detected as duplicate during local update, inherit duplicate from MAC", "VNI %u: MAC %pEA IP %pIA detected as duplicate during local update, inherit duplicate from MAC",
zevpn->vni, prefix_mac2str(macaddr, buf, sizeof(buf)), zevpn->vni, macaddr, &n->ip);
ipaddr2str(&n->ip, buf2, sizeof(buf2)));
} }
/* For IP Duplicate Address Detection (DAD) is trigger, /* For IP Duplicate Address Detection (DAD) is trigger,
@ -1651,9 +1569,9 @@ int zebra_evpn_local_neigh_update(zebra_evpn_t *zevpn, struct interface *ifp,
if (upd_mac_seq && zmac->loc_seq != mac_new_seq) { if (upd_mac_seq && zmac->loc_seq != mac_new_seq) {
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"Seq changed for MAC %s VNI %u - old %u new %u", "Seq changed for MAC %pEA VNI %u - old %u new %u",
prefix_mac2str(macaddr, buf, sizeof(buf)), macaddr, zevpn->vni,
zevpn->vni, zmac->loc_seq, mac_new_seq); zmac->loc_seq, mac_new_seq);
zmac->loc_seq = mac_new_seq; zmac->loc_seq = mac_new_seq;
if (zebra_evpn_mac_send_add_to_client(zevpn->vni, macaddr, if (zebra_evpn_mac_send_add_to_client(zevpn->vni, macaddr,
zmac->flags, zmac->flags,
@ -1682,8 +1600,6 @@ int zebra_evpn_remote_neigh_update(zebra_evpn_t *zevpn, struct interface *ifp,
struct ipaddr *ip, struct ethaddr *macaddr, struct ipaddr *ip, struct ethaddr *macaddr,
uint16_t state) uint16_t state)
{ {
char buf[ETHER_ADDR_STRLEN];
char buf2[INET6_ADDRSTRLEN];
zebra_neigh_t *n = NULL; zebra_neigh_t *n = NULL;
zebra_mac_t *zmac = NULL; zebra_mac_t *zmac = NULL;
@ -1708,10 +1624,8 @@ int zebra_evpn_remote_neigh_update(zebra_evpn_t *zevpn, struct interface *ifp,
zmac = zebra_evpn_mac_lookup(zevpn, macaddr); zmac = zebra_evpn_mac_lookup(zevpn, macaddr);
if (!zmac || !CHECK_FLAG(zmac->flags, ZEBRA_MAC_REMOTE)) { if (!zmac || !CHECK_FLAG(zmac->flags, ZEBRA_MAC_REMOTE)) {
zlog_debug( zlog_debug(
"Ignore remote neigh %s (MAC %s) on L2-VNI %u - MAC unknown or local", "Ignore remote neigh %pIA (MAC %pEA) on L2-VNI %u - MAC unknown or local",
ipaddr2str(&n->ip, buf2, sizeof(buf2)), &n->ip, macaddr, zevpn->vni);
prefix_mac2str(macaddr, buf, sizeof(buf)),
zevpn->vni);
return -1; return -1;
} }
@ -2140,8 +2054,6 @@ void process_neigh_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf,
{ {
zebra_neigh_t *n; zebra_neigh_t *n;
int update_neigh = 0; int update_neigh = 0;
char buf[ETHER_ADDR_STRLEN];
char buf1[INET6_ADDRSTRLEN];
zebra_mac_t *old_mac = NULL; zebra_mac_t *old_mac = NULL;
bool old_static = false; bool old_static = false;
bool do_dad = false; bool do_dad = false;
@ -2167,11 +2079,9 @@ void process_neigh_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf,
mac, 0); mac, 0);
if (!n) { if (!n) {
zlog_warn( zlog_warn(
"Failed to add Neigh %s MAC %s VNI %u Remote VTEP %pI4", "Failed to add Neigh %pIA MAC %pEA VNI %u Remote VTEP %pI4",
ipaddr2str(ipaddr, buf1, sizeof(buf1)), ipaddr, &mac->macaddr, zevpn->vni,
prefix_mac2str(&mac->macaddr, buf, &vtep_ip);
sizeof(buf)),
zevpn->vni, &vtep_ip);
return; return;
} }
@ -2192,12 +2102,8 @@ void process_neigh_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf,
old_static = zebra_evpn_neigh_is_static(n); old_static = zebra_evpn_neigh_is_static(n);
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug( zlog_debug(
"sync->remote neigh vni %u ip %s mac %s seq %d f0x%x", "sync->remote neigh vni %u ip %pIA mac %pEA seq %d f0x%x",
n->zevpn->vni, n->zevpn->vni, &n->ip, &n->emac,
ipaddr2str(&n->ip, buf1,
sizeof(buf1)),
prefix_mac2str(&n->emac, buf,
sizeof(buf)),
seq, n->flags); seq, n->flags);
zebra_evpn_neigh_clear_sync_info(n); zebra_evpn_neigh_clear_sync_info(n);
if (IS_ZEBRA_NEIGH_ACTIVE(n)) if (IS_ZEBRA_NEIGH_ACTIVE(n))
@ -2258,10 +2164,8 @@ void process_neigh_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf,
if (zebra_evpn_ip_inherit_dad_from_mac(zvrf, old_mac, mac, n)) { if (zebra_evpn_ip_inherit_dad_from_mac(zvrf, old_mac, mac, n)) {
flog_warn( flog_warn(
EC_ZEBRA_DUP_IP_INHERIT_DETECTED, EC_ZEBRA_DUP_IP_INHERIT_DETECTED,
"VNI %u: MAC %s IP %s detected as duplicate during remote update, inherit duplicate from MAC", "VNI %u: MAC %pEA IP %pIA detected as duplicate during remote update, inherit duplicate from MAC",
zevpn->vni, zevpn->vni, &mac->macaddr, &n->ip);
prefix_mac2str(&mac->macaddr, buf, sizeof(buf)),
ipaddr2str(&n->ip, buf1, sizeof(buf1)));
} }
/* Check duplicate address detection for IP */ /* Check duplicate address detection for IP */
@ -2280,8 +2184,6 @@ int zebra_evpn_neigh_gw_macip_add(struct interface *ifp, zebra_evpn_t *zevpn,
struct ipaddr *ip, zebra_mac_t *mac) struct ipaddr *ip, zebra_mac_t *mac)
{ {
zebra_neigh_t *n; zebra_neigh_t *n;
char buf[ETHER_ADDR_STRLEN];
char buf2[INET6_ADDRSTRLEN];
assert(mac); assert(mac);
@ -2291,9 +2193,8 @@ int zebra_evpn_neigh_gw_macip_add(struct interface *ifp, zebra_evpn_t *zevpn,
if (!n) { if (!n) {
flog_err( flog_err(
EC_ZEBRA_MAC_ADD_FAILED, EC_ZEBRA_MAC_ADD_FAILED,
"Failed to add neighbor %s MAC %s intf %s(%u) -> VNI %u", "Failed to add neighbor %pIA MAC %pEA intf %s(%u) -> VNI %u",
ipaddr2str(ip, buf2, sizeof(buf2)), ip, &mac->macaddr,
prefix_mac2str(&mac->macaddr, buf, sizeof(buf)),
ifp->name, ifp->ifindex, zevpn->vni); ifp->name, ifp->ifindex, zevpn->vni);
return -1; return -1;
} }
@ -2316,10 +2217,9 @@ int zebra_evpn_neigh_gw_macip_add(struct interface *ifp, zebra_evpn_t *zevpn,
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( 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 %pEA IP %pIA add to BGP with flags 0x%x",
ifp->name, ifp->ifindex, zevpn->vni, ifp->name, ifp->ifindex, zevpn->vni,
prefix_mac2str(&mac->macaddr, buf, sizeof(buf)), &mac->macaddr, ip, n->flags);
ipaddr2str(ip, buf2, sizeof(buf2)), n->flags);
zebra_evpn_neigh_send_add_to_client( zebra_evpn_neigh_send_add_to_client(
zevpn->vni, ip, &n->emac, n->mac, n->flags, n->loc_seq); zevpn->vni, ip, &n->emac, n->mac, n->flags, n->loc_seq);
@ -2328,10 +2228,9 @@ int zebra_evpn_neigh_gw_macip_add(struct interface *ifp, zebra_evpn_t *zevpn,
SET_FLAG(n->flags, ZEBRA_NEIGH_SVI_IP); SET_FLAG(n->flags, ZEBRA_NEIGH_SVI_IP);
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"SVI %s(%u) L2-VNI %u, sending SVI MAC %s IP %s add to BGP with flags 0x%x", "SVI %s(%u) L2-VNI %u, sending SVI MAC %pEA IP %pIA add to BGP with flags 0x%x",
ifp->name, ifp->ifindex, zevpn->vni, ifp->name, ifp->ifindex, zevpn->vni,
prefix_mac2str(&mac->macaddr, buf, sizeof(buf)), &mac->macaddr, ip, n->flags);
ipaddr2str(ip, buf2, sizeof(buf2)), n->flags);
zebra_evpn_neigh_send_add_to_client( zebra_evpn_neigh_send_add_to_client(
zevpn->vni, ip, &n->emac, n->mac, n->flags, n->loc_seq); zevpn->vni, ip, &n->emac, n->mac, n->flags, n->loc_seq);
@ -2344,8 +2243,6 @@ void zebra_evpn_neigh_remote_uninstall(zebra_evpn_t *zevpn,
struct zebra_vrf *zvrf, zebra_neigh_t *n, struct zebra_vrf *zvrf, zebra_neigh_t *n,
zebra_mac_t *mac, struct ipaddr *ipaddr) zebra_mac_t *mac, struct ipaddr *ipaddr)
{ {
char buf1[INET6_ADDRSTRLEN];
if (zvrf->dad_freeze && CHECK_FLAG(n->flags, ZEBRA_NEIGH_DUPLICATE) if (zvrf->dad_freeze && CHECK_FLAG(n->flags, ZEBRA_NEIGH_DUPLICATE)
&& CHECK_FLAG(n->flags, ZEBRA_NEIGH_REMOTE) && CHECK_FLAG(n->flags, ZEBRA_NEIGH_REMOTE)
&& (memcmp(n->emac.octet, mac->macaddr.octet, ETH_ALEN) == 0)) { && (memcmp(n->emac.octet, mac->macaddr.octet, ETH_ALEN) == 0)) {
@ -2354,10 +2251,9 @@ void zebra_evpn_neigh_remote_uninstall(zebra_evpn_t *zevpn,
vlan_if = zevpn_map_to_svi(zevpn); vlan_if = zevpn_map_to_svi(zevpn);
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"%s: IP %s (flags 0x%x intf %s) is remote and duplicate, read kernel for local entry", "%s: IP %pIA (flags 0x%x intf %s) is remote and duplicate, read kernel for local entry",
__func__, __func__, ipaddr, n->flags,
ipaddr2str(ipaddr, buf1, sizeof(buf1)), vlan_if ? vlan_if->name : "Unknown");
n->flags, vlan_if ? vlan_if->name : "Unknown");
if (vlan_if) if (vlan_if)
neigh_read_specific_ip(ipaddr, vlan_if); neigh_read_specific_ip(ipaddr, vlan_if);
} }
@ -2384,8 +2280,6 @@ int zebra_evpn_neigh_del_ip(zebra_evpn_t *zevpn, struct ipaddr *ip)
zebra_mac_t *zmac; zebra_mac_t *zmac;
bool old_bgp_ready; bool old_bgp_ready;
bool new_bgp_ready; bool new_bgp_ready;
char buf[INET6_ADDRSTRLEN];
char buf2[ETHER_ADDR_STRLEN];
struct zebra_vrf *zvrf; struct zebra_vrf *zvrf;
/* If entry doesn't exist, nothing to do. */ /* If entry doesn't exist, nothing to do. */
@ -2397,9 +2291,8 @@ int zebra_evpn_neigh_del_ip(zebra_evpn_t *zevpn, struct ipaddr *ip)
if (!zmac) { if (!zmac) {
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"Trying to del a neigh %s without a mac %s on VNI %u", "Trying to del a neigh %pIA without a mac %pEA on VNI %u",
ipaddr2str(ip, buf, sizeof(buf)), ip, &n->emac,
prefix_mac2str(&n->emac, buf2, sizeof(buf2)),
zevpn->vni); zevpn->vni);
return 0; return 0;
@ -2419,10 +2312,8 @@ int zebra_evpn_neigh_del_ip(zebra_evpn_t *zevpn, struct ipaddr *ip)
old_bgp_ready = zebra_evpn_neigh_is_ready_for_bgp(n); old_bgp_ready = zebra_evpn_neigh_is_ready_for_bgp(n);
if (zebra_evpn_neigh_is_static(n)) { if (zebra_evpn_neigh_is_static(n)) {
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug("re-add sync neigh vni %u ip %s mac %s 0x%x", zlog_debug("re-add sync neigh vni %u ip %pIA mac %pEA 0x%x",
n->zevpn->vni, n->zevpn->vni, &n->ip, &n->emac,
ipaddr2str(&n->ip, buf, sizeof(buf)),
prefix_mac2str(&n->emac, buf2, sizeof(buf2)),
n->flags); n->flags);
if (!CHECK_FLAG(n->flags, ZEBRA_NEIGH_LOCAL_INACTIVE)) if (!CHECK_FLAG(n->flags, ZEBRA_NEIGH_LOCAL_INACTIVE))

View file

@ -167,18 +167,12 @@ static inline bool zebra_evpn_neigh_is_ready_for_bgp(zebra_neigh_t *n)
static inline void zebra_evpn_neigh_stop_hold_timer(zebra_neigh_t *n) static inline void zebra_evpn_neigh_stop_hold_timer(zebra_neigh_t *n)
{ {
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN];
if (!n->hold_timer) if (!n->hold_timer)
return; return;
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug("sync-neigh vni %u ip %s mac %s 0x%x hold stop", zlog_debug("sync-neigh vni %u ip %pIA mac %pEA 0x%x hold stop",
n->zevpn->vni, n->zevpn->vni, &n->ip, &n->emac, n->flags);
ipaddr2str(&n->ip, ipbuf, sizeof(ipbuf)),
prefix_mac2str(&n->emac, macbuf, sizeof(macbuf)),
n->flags);
THREAD_OFF(n->hold_timer); THREAD_OFF(n->hold_timer);
} }
@ -188,19 +182,13 @@ void zebra_evpn_sync_neigh_static_chg(zebra_neigh_t *n, bool old_n_static,
static inline bool zebra_evpn_neigh_clear_sync_info(zebra_neigh_t *n) static inline bool zebra_evpn_neigh_clear_sync_info(zebra_neigh_t *n)
{ {
char macbuf[ETHER_ADDR_STRLEN];
char ipbuf[INET6_ADDRSTRLEN];
bool old_n_static = false; bool old_n_static = false;
bool new_n_static = false; bool new_n_static = false;
if (n->flags & ZEBRA_NEIGH_ALL_PEER_FLAGS) { if (n->flags & ZEBRA_NEIGH_ALL_PEER_FLAGS) {
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug("sync-neigh vni %u ip %s mac %s 0x%x clear", zlog_debug("sync-neigh vni %u ip %pIA mac %pEA 0x%x clear",
n->zevpn->vni, n->zevpn->vni, &n->ip, &n->emac, n->flags);
ipaddr2str(&n->ip, ipbuf, sizeof(ipbuf)),
prefix_mac2str(&n->emac, macbuf,
sizeof(macbuf)),
n->flags);
old_n_static = zebra_evpn_neigh_is_static(n); old_n_static = zebra_evpn_neigh_is_static(n);
UNSET_FLAG(n->flags, ZEBRA_NEIGH_ALL_PEER_FLAGS); UNSET_FLAG(n->flags, ZEBRA_NEIGH_ALL_PEER_FLAGS);

View file

@ -1226,7 +1226,6 @@ static int zl3vni_rmac_install(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac)
*/ */
static int zl3vni_rmac_uninstall(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac) static int zl3vni_rmac_uninstall(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac)
{ {
char buf[ETHER_ADDR_STRLEN];
const struct zebra_if *zif = NULL, *br_zif; const struct zebra_if *zif = NULL, *br_zif;
const struct zebra_l2info_vxlan *vxl = NULL; const struct zebra_l2info_vxlan *vxl = NULL;
const struct interface *br_ifp; const struct interface *br_ifp;
@ -1240,10 +1239,8 @@ static int zl3vni_rmac_uninstall(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac)
if (!zl3vni->vxlan_if) { if (!zl3vni->vxlan_if) {
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"RMAC %s on L3-VNI %u hash %p couldn't be uninstalled - no vxlan_if", "RMAC %pEA on L3-VNI %u hash %p couldn't be uninstalled - no vxlan_if",
prefix_mac2str(&zrmac->macaddr, &zrmac->macaddr, zl3vni->vni, zl3vni);
buf, sizeof(buf)),
zl3vni->vni, zl3vni);
return -1; return -1;
} }
@ -1277,8 +1274,6 @@ static int zl3vni_remote_rmac_add(zebra_l3vni_t *zl3vni,
const struct ipaddr *vtep_ip, const struct ipaddr *vtep_ip,
const struct prefix *host_prefix) const struct prefix *host_prefix)
{ {
char buf[ETHER_ADDR_STRLEN];
char buf1[INET6_ADDRSTRLEN];
zebra_mac_t *zrmac = NULL; zebra_mac_t *zrmac = NULL;
zrmac = zl3vni_rmac_lookup(zl3vni, rmac); zrmac = zl3vni_rmac_lookup(zl3vni, rmac);
@ -1288,11 +1283,8 @@ static int zl3vni_remote_rmac_add(zebra_l3vni_t *zl3vni,
zrmac = zl3vni_rmac_add(zl3vni, rmac); zrmac = zl3vni_rmac_add(zl3vni, rmac);
if (!zrmac) { if (!zrmac) {
zlog_debug( zlog_debug(
"Failed to add RMAC %s L3VNI %u Remote VTEP %s, prefix %pFX", "Failed to add RMAC %pEA L3VNI %u Remote VTEP %pIA, prefix %pFX",
prefix_mac2str(rmac, buf, sizeof(buf)), rmac, zl3vni->vni, vtep_ip, host_prefix);
zl3vni->vni,
ipaddr2str(vtep_ip, buf1, sizeof(buf1)),
host_prefix);
return -1; return -1;
} }
memset(&zrmac->fwd_info, 0, sizeof(zrmac->fwd_info)); memset(&zrmac->fwd_info, 0, sizeof(zrmac->fwd_info));
@ -1308,12 +1300,9 @@ static int zl3vni_remote_rmac_add(zebra_l3vni_t *zl3vni,
&vtep_ip->ipaddr_v4)) { &vtep_ip->ipaddr_v4)) {
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"L3VNI %u Remote VTEP change(%pI4 -> %s) for RMAC %s, prefix %pFX", "L3VNI %u Remote VTEP change(%pI4 -> %pIA) for RMAC %pEA, prefix %pFX",
zl3vni->vni, zl3vni->vni, &zrmac->fwd_info.r_vtep_ip,
&zrmac->fwd_info.r_vtep_ip, vtep_ip, rmac, host_prefix);
ipaddr2str(vtep_ip, buf1, sizeof(buf1)),
prefix_mac2str(rmac, buf, sizeof(buf)),
host_prefix);
zrmac->fwd_info.r_vtep_ip = vtep_ip->ipaddr_v4; zrmac->fwd_info.r_vtep_ip = vtep_ip->ipaddr_v4;
@ -1470,9 +1459,6 @@ static int zl3vni_remote_nh_add(zebra_l3vni_t *zl3vni,
const struct ethaddr *rmac, const struct ethaddr *rmac,
const struct prefix *host_prefix) const struct prefix *host_prefix)
{ {
char buf[ETHER_ADDR_STRLEN];
char buf1[ETHER_ADDR_STRLEN];
char buf2[INET6_ADDRSTRLEN];
zebra_neigh_t *nh = NULL; zebra_neigh_t *nh = NULL;
/* Create the next hop entry, or update its mac, if necessary. */ /* Create the next hop entry, or update its mac, if necessary. */
@ -1481,10 +1467,8 @@ static int zl3vni_remote_nh_add(zebra_l3vni_t *zl3vni,
nh = zl3vni_nh_add(zl3vni, vtep_ip, rmac); nh = zl3vni_nh_add(zl3vni, vtep_ip, rmac);
if (!nh) { if (!nh) {
zlog_debug( zlog_debug(
"Failed to add NH %s as Neigh (RMAC %s L3-VNI %u prefix %pFX)", "Failed to add NH %pIA as Neigh (RMAC %pEA L3-VNI %u prefix %pFX)",
ipaddr2str(vtep_ip, buf1, sizeof(buf2)), vtep_ip, rmac, zl3vni->vni, host_prefix);
prefix_mac2str(rmac, buf, sizeof(buf)),
zl3vni->vni, host_prefix);
return -1; return -1;
} }
@ -1493,11 +1477,8 @@ static int zl3vni_remote_nh_add(zebra_l3vni_t *zl3vni,
} else if (memcmp(&nh->emac, rmac, ETH_ALEN) != 0) { } else if (memcmp(&nh->emac, rmac, ETH_ALEN) != 0) {
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"L3VNI %u RMAC change(%s --> %s) for nexthop %s, prefix %pFX", "L3VNI %u RMAC change(%pEA --> %pEA) for nexthop %pIA, prefix %pFX",
zl3vni->vni, zl3vni->vni, &nh->emac, rmac, vtep_ip,
prefix_mac2str(&nh->emac, buf, sizeof(buf)),
prefix_mac2str(rmac, buf1, sizeof(buf1)),
ipaddr2str(vtep_ip, buf2, sizeof(buf2)),
host_prefix); host_prefix);
memcpy(&nh->emac, rmac, ETH_ALEN); memcpy(&nh->emac, rmac, ETH_ALEN);
@ -1878,8 +1859,6 @@ static int zl3vni_send_add_to_client(zebra_l3vni_t *zl3vni)
struct zserv *client = NULL; struct zserv *client = NULL;
struct ethaddr svi_rmac, vrr_rmac = {.octet = {0} }; struct ethaddr svi_rmac, vrr_rmac = {.octet = {0} };
struct zebra_vrf *zvrf; struct zebra_vrf *zvrf;
char buf[ETHER_ADDR_STRLEN];
char buf1[ETHER_ADDR_STRLEN];
bool is_anycast_mac = true; bool is_anycast_mac = true;
client = zserv_find_client(ZEBRA_ROUTE_BGP, 0); client = zserv_find_client(ZEBRA_ROUTE_BGP, 0);
@ -1920,11 +1899,9 @@ static int zl3vni_send_add_to_client(zebra_l3vni_t *zl3vni)
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"Send L3_VNI_ADD %u VRF %s RMAC %s VRR %s local-ip %pI4 filter %s to %s", "Send L3_VNI_ADD %u VRF %s RMAC %pEA VRR %pEA local-ip %pI4 filter %s to %s",
zl3vni->vni, vrf_id_to_name(zl3vni_vrf_id(zl3vni)), zl3vni->vni, vrf_id_to_name(zl3vni_vrf_id(zl3vni)),
prefix_mac2str(&svi_rmac, buf, sizeof(buf)), &svi_rmac, &vrr_rmac, &zl3vni->local_vtep_ip,
prefix_mac2str(&vrr_rmac, buf1, sizeof(buf1)),
&zl3vni->local_vtep_ip,
CHECK_FLAG(zl3vni->filter, PREFIX_ROUTES_ONLY) CHECK_FLAG(zl3vni->filter, PREFIX_ROUTES_ONLY)
? "prefix-routes-only" ? "prefix-routes-only"
: "none", : "none",
@ -2138,7 +2115,6 @@ static void zl3vni_del_nh_hash_entry(struct hash_bucket *bucket, void *ctx)
static int zebra_vxlan_readd_remote_rmac(zebra_l3vni_t *zl3vni, static int zebra_vxlan_readd_remote_rmac(zebra_l3vni_t *zl3vni,
struct ethaddr *rmac) struct ethaddr *rmac)
{ {
char buf[ETHER_ADDR_STRLEN];
zebra_mac_t *zrmac = NULL; zebra_mac_t *zrmac = NULL;
zrmac = zl3vni_rmac_lookup(zl3vni, rmac); zrmac = zl3vni_rmac_lookup(zl3vni, rmac);
@ -2146,8 +2122,8 @@ static int zebra_vxlan_readd_remote_rmac(zebra_l3vni_t *zl3vni,
return 0; return 0;
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug("Del remote RMAC %s L3VNI %u - readd", zlog_debug("Del remote RMAC %pEA L3VNI %u - readd",
prefix_mac2str(rmac, buf, sizeof(buf)), zl3vni->vni); rmac, zl3vni->vni);
zl3vni_rmac_install(zl3vni, zrmac); zl3vni_rmac_install(zl3vni, zrmac);
return 0; return 0;
@ -3667,7 +3643,6 @@ int zebra_vxlan_handle_kernel_neigh_del(struct interface *ifp,
struct interface *link_if, struct interface *link_if,
struct ipaddr *ip) struct ipaddr *ip)
{ {
char buf[INET6_ADDRSTRLEN];
zebra_evpn_t *zevpn = NULL; zebra_evpn_t *zevpn = NULL;
zebra_l3vni_t *zl3vni = NULL; zebra_l3vni_t *zl3vni = NULL;
@ -3685,9 +3660,8 @@ int zebra_vxlan_handle_kernel_neigh_del(struct interface *ifp,
if (!zevpn) { if (!zevpn) {
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"%s: Del neighbor %s EVPN is not present for interface %s", "%s: Del neighbor %pIA EVPN is not present for interface %s",
__func__, ipaddr2str(ip, buf, sizeof(buf)), __func__, ip, ifp->name);
ifp->name);
return 0; return 0;
} }
@ -3699,9 +3673,8 @@ int zebra_vxlan_handle_kernel_neigh_del(struct interface *ifp,
} }
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug("Del neighbor %s intf %s(%u) -> L2-VNI %u", zlog_debug("Del neighbor %pIA intf %s(%u) -> L2-VNI %u",
ipaddr2str(ip, buf, sizeof(buf)), ifp->name, ip, ifp->name, ifp->ifindex, zevpn->vni);
ifp->ifindex, zevpn->vni);
return zebra_evpn_neigh_del_ip(zevpn, ip); return zebra_evpn_neigh_del_ip(zevpn, ip);
} }
@ -3721,8 +3694,6 @@ int zebra_vxlan_handle_kernel_neigh_update(struct interface *ifp,
bool is_router, bool is_router,
bool local_inactive, bool dp_static) bool local_inactive, bool dp_static)
{ {
char buf[ETHER_ADDR_STRLEN];
char buf2[INET6_ADDRSTRLEN];
zebra_evpn_t *zevpn = NULL; zebra_evpn_t *zevpn = NULL;
zebra_l3vni_t *zl3vni = NULL; zebra_l3vni_t *zl3vni = NULL;
@ -3742,9 +3713,8 @@ int zebra_vxlan_handle_kernel_neigh_update(struct interface *ifp,
if (IS_ZEBRA_DEBUG_VXLAN || IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) if (IS_ZEBRA_DEBUG_VXLAN || IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug( zlog_debug(
"Add/Update neighbor %s MAC %s intf %s(%u) state 0x%x %s%s%s%s-> L2-VNI %u", "Add/Update neighbor %pIA MAC %pEA intf %s(%u) state 0x%x %s%s%s%s-> L2-VNI %u",
ipaddr2str(ip, buf2, sizeof(buf2)), ip, macaddr, ifp->name,
prefix_mac2str(macaddr, buf, sizeof(buf)), ifp->name,
ifp->ifindex, state, is_ext ? "ext-learned " : "", ifp->ifindex, state, is_ext ? "ext-learned " : "",
is_router ? "router " : "", is_router ? "router " : "",
local_inactive ? "local_inactive " : "", local_inactive ? "local_inactive " : "",
@ -3822,7 +3792,6 @@ void zebra_vxlan_remote_macip_del(ZAPI_HANDLER_ARGS)
struct ipaddr ip; struct ipaddr ip;
struct in_addr vtep_ip; struct in_addr vtep_ip;
uint16_t l = 0, ipa_len; uint16_t l = 0, ipa_len;
char buf[ETHER_ADDR_STRLEN];
char buf1[INET6_ADDRSTRLEN]; char buf1[INET6_ADDRSTRLEN];
memset(&macaddr, 0, sizeof(struct ethaddr)); memset(&macaddr, 0, sizeof(struct ethaddr));
@ -3842,9 +3811,8 @@ void zebra_vxlan_remote_macip_del(ZAPI_HANDLER_ARGS)
l += res_length; l += res_length;
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"Recv MACIP DEL VNI %u MAC %s%s%s Remote VTEP %pI4 from %s", "Recv MACIP DEL VNI %u MAC %pEA%s%s Remote VTEP %pI4 from %s",
vni, vni, &macaddr,
prefix_mac2str(&macaddr, buf, sizeof(buf)),
ipa_len ? " IP " : "", ipa_len ? " IP " : "",
ipa_len ? ipa_len ?
ipaddr2str(&ip, buf1, sizeof(buf1)) : "", ipaddr2str(&ip, buf1, sizeof(buf1)) : "",
@ -3872,7 +3840,6 @@ void zebra_vxlan_remote_macip_add(ZAPI_HANDLER_ARGS)
uint16_t l = 0, ipa_len; uint16_t l = 0, ipa_len;
uint8_t flags = 0; uint8_t flags = 0;
uint32_t seq; uint32_t seq;
char buf[ETHER_ADDR_STRLEN];
char buf1[INET6_ADDRSTRLEN]; char buf1[INET6_ADDRSTRLEN];
esi_t esi; esi_t esi;
char esi_buf[ESI_STR_LEN]; char esi_buf[ESI_STR_LEN];
@ -3903,11 +3870,10 @@ void zebra_vxlan_remote_macip_add(ZAPI_HANDLER_ARGS)
else else
strlcpy(esi_buf, "-", ESI_STR_LEN); strlcpy(esi_buf, "-", ESI_STR_LEN);
zlog_debug( zlog_debug(
"Recv %sMACIP ADD VNI %u MAC %s%s%s flags 0x%x seq %u VTEP %pI4 ESI %s from %s", "Recv %sMACIP ADD VNI %u MAC %pEA%s%s flags 0x%x seq %u VTEP %pI4 ESI %s from %s",
(flags & ZEBRA_MACIP_TYPE_SYNC_PATH) ? (flags & ZEBRA_MACIP_TYPE_SYNC_PATH) ?
"sync-" : "", "sync-" : "",
vni, vni, &macaddr,
prefix_mac2str(&macaddr, buf, sizeof(buf)),
ipa_len ? " IP " : "", ipa_len ? " IP " : "",
ipa_len ? ipa_len ?
ipaddr2str(&ip, buf1, sizeof(buf1)) : "", ipaddr2str(&ip, buf1, sizeof(buf1)) : "",
@ -3984,7 +3950,6 @@ static int zebra_vxlan_check_del_local_mac(struct interface *ifp,
vni_t vni; vni_t vni;
zebra_evpn_t *zevpn; zebra_evpn_t *zevpn;
zebra_mac_t *mac; zebra_mac_t *mac;
char buf[ETHER_ADDR_STRLEN];
zif = ifp->info; zif = ifp->info;
assert(zif); assert(zif);
@ -4011,9 +3976,8 @@ static int zebra_vxlan_check_del_local_mac(struct interface *ifp,
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
"Add/update remote MAC %s intf %s(%u) VNI %u flags 0x%x - del local", "Add/update remote MAC %pEA intf %s(%u) VNI %u flags 0x%x - del local",
prefix_mac2str(macaddr, buf, sizeof(buf)), ifp->name, macaddr, ifp->name, ifp->ifindex, vni, mac->flags);
ifp->ifindex, vni, mac->flags);
/* Remove MAC from BGP. */ /* Remove MAC from BGP. */
zebra_evpn_mac_send_del_to_client(zevpn->vni, macaddr, mac->flags, zebra_evpn_mac_send_del_to_client(zevpn->vni, macaddr, mac->flags,
@ -4175,7 +4139,6 @@ int zebra_vxlan_local_mac_add_update(struct interface *ifp,
{ {
zebra_evpn_t *zevpn; zebra_evpn_t *zevpn;
struct zebra_vrf *zvrf; struct zebra_vrf *zvrf;
char buf[ETHER_ADDR_STRLEN];
assert(ifp); assert(ifp);
@ -4186,9 +4149,8 @@ int zebra_vxlan_local_mac_add_update(struct interface *ifp,
if (!zevpn) { if (!zevpn) {
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug( zlog_debug(
" Add/Update %sMAC %s intf %s(%u) VID %u, could not find EVPN", " Add/Update %sMAC %pEA intf %s(%u) VID %u, could not find EVPN",
sticky ? "sticky " : "", sticky ? "sticky " : "", macaddr,
prefix_mac2str(macaddr, buf, sizeof(buf)),
ifp->name, ifp->ifindex, vid); ifp->name, ifp->ifindex, vid);
return 0; return 0;
} }