zserv_create_header(s, cmd, zvrf_id(zvrf));
stream_putl(s, vni);
- stream_put(s, macaddr->octet, ETHER_ADDR_LEN);
+ stream_put(s, macaddr->octet, ETH_ALEN);
if (ip) {
ipa_len = 0;
if (IS_IPADDR_V4(ip))
zebra_mac_t *pmac = p;
const void *pnt = (void *)pmac->macaddr.octet;
- return jhash(pnt, ETHER_ADDR_LEN, 0xa5a5a55a);
+ return jhash(pnt, ETH_ALEN, 0xa5a5a55a);
}
/*
return 0;
return (memcmp(pmac1->macaddr.octet, pmac2->macaddr.octet,
- ETHER_ADDR_LEN)
+ ETH_ALEN)
== 0);
}
zebra_mac_t *mac = NULL;
memset(&tmp_mac, 0, sizeof(zebra_mac_t));
- memcpy(&tmp_mac.macaddr, macaddr, ETHER_ADDR_LEN);
+ memcpy(&tmp_mac.macaddr, macaddr, ETH_ALEN);
mac = hash_get(zvni->mac_table, &tmp_mac, zvni_mac_alloc);
assert(mac);
zebra_mac_t *pmac;
memset(&tmp, 0, sizeof(tmp));
- memcpy(&tmp.macaddr, mac, ETHER_ADDR_LEN);
+ memcpy(&tmp.macaddr, mac, ETH_ALEN);
pmac = hash_lookup(zvni->mac_table, &tmp);
return pmac;
if (n) {
if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_LOCAL)) {
if (memcmp(n->emac.octet, macaddr->octet,
- ETHER_ADDR_LEN)
+ ETH_ALEN)
== 0) {
if (n->ifindex == ifp->ifindex)
/* we're not interested in whatever has
/* Set "local" forwarding info. */
SET_FLAG(n->flags, ZEBRA_NEIGH_LOCAL);
- memcpy(&n->emac, macaddr, ETHER_ADDR_LEN);
+ memcpy(&n->emac, macaddr, ETH_ALEN);
n->ifindex = ifp->ifindex;
/* Inform BGP if required. */
n = NULL;
memset(&ip, 0, sizeof(ip));
vni = (vni_t)stream_getl(s);
- stream_get(&macaddr.octet, s, ETHER_ADDR_LEN);
+ stream_get(&macaddr.octet, s, ETH_ALEN);
ipa_len = stream_getl(s);
if (ipa_len) {
ip.ipa_type = (ipa_len == IPV4_MAX_BYTELEN) ? IPADDR_V4
: IPADDR_V6;
stream_get(&ip.ip.addr, s, ipa_len);
}
- l += 4 + ETHER_ADDR_LEN + 4 + ipa_len;
+ l += 4 + ETH_ALEN + 4 + ipa_len;
vtep_ip.s_addr = stream_get_ipv4(s);
l += IPV4_MAX_BYTELEN;
*/
if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_REMOTE)
&& (memcmp(n->emac.octet, macaddr.octet,
- ETHER_ADDR_LEN)
+ ETH_ALEN)
== 0)) {
zvni_neigh_uninstall(zvni, n);
zvni_neigh_del(zvni, n);
n = NULL;
memset(&ip, 0, sizeof(ip));
vni = (vni_t)stream_getl(s);
- stream_get(&macaddr.octet, s, ETHER_ADDR_LEN);
+ stream_get(&macaddr.octet, s, ETH_ALEN);
ipa_len = stream_getl(s);
if (ipa_len) {
ip.ipa_type = (ipa_len == IPV4_MAX_BYTELEN) ? IPADDR_V4
: IPADDR_V6;
stream_get(&ip.ip.addr, s, ipa_len);
}
- l += 4 + ETHER_ADDR_LEN + 4 + ipa_len;
+ l += 4 + ETH_ALEN + 4 + ipa_len;
vtep_ip.s_addr = stream_get_ipv4(s);
l += IPV4_MAX_BYTELEN;
/* Set "remote" forwarding info. */
UNSET_FLAG(n->flags, ZEBRA_NEIGH_LOCAL);
/* TODO: Handle MAC change. */
- memcpy(&n->emac, &macaddr, ETHER_ADDR_LEN);
+ memcpy(&n->emac, &macaddr, ETH_ALEN);
n->r_vtep_ip = vtep_ip;
SET_FLAG(n->flags, ZEBRA_NEIGH_REMOTE);