summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-08-03 14:45:27 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-08-04 15:06:14 +0200
commit28328ea9534f8fc8a5279f0a9751f1de239869b3 (patch)
tree0bc791a4a0b9cddd6d5579a197b7ef307a1093a7 /bgpd
parentldpd: Switch to using ETH_ALEN (diff)
downloadfrr-28328ea9534f8fc8a5279f0a9751f1de239869b3.tar.xz
frr-28328ea9534f8fc8a5279f0a9751f1de239869b3.zip
bgpd: Convert to using ETH_ALEN
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_attr_evpn.c2
-rw-r--r--bgpd/bgp_evpn.c14
-rw-r--r--bgpd/bgp_evpn_private.h2
-rw-r--r--bgpd/bgp_rd.c2
-rw-r--r--bgpd/bgp_route.c2
-rw-r--r--bgpd/bgp_zebra.c2
-rw-r--r--bgpd/rfapi/rfapi.c4
-rw-r--r--bgpd/rfapi/rfapi_import.c4
-rw-r--r--bgpd/rfapi/rfapi_monitor.c4
-rw-r--r--bgpd/rfapi/rfapi_rib.c2
-rw-r--r--bgpd/rfapi/rfapi_vty.c4
11 files changed, 21 insertions, 21 deletions
diff --git a/bgpd/bgp_attr_evpn.c b/bgpd/bgp_attr_evpn.c
index cd6b87b29..2f0b566cc 100644
--- a/bgpd/bgp_attr_evpn.c
+++ b/bgpd/bgp_attr_evpn.c
@@ -42,7 +42,7 @@ void bgp_add_routermac_ecom(struct attr *attr, struct ethaddr *routermac)
memset(&routermac_ecom, 0, sizeof(struct ecommunity_val));
routermac_ecom.val[0] = ECOMMUNITY_ENCODE_EVPN;
routermac_ecom.val[1] = ECOMMUNITY_EVPN_SUBTYPE_ROUTERMAC;
- memcpy(&routermac_ecom.val[2], routermac->octet, ETHER_ADDR_LEN);
+ memcpy(&routermac_ecom.val[2], routermac->octet, ETH_ALEN);
if (!attr->ecommunity)
attr->ecommunity = ecommunity_new();
ecommunity_add_val(attr->ecommunity, &routermac_ecom);
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
index f0081e6d0..fe311832a 100644
--- a/bgpd/bgp_evpn.c
+++ b/bgpd/bgp_evpn.c
@@ -351,7 +351,7 @@ static int bgp_zebra_send_remote_macip(struct bgp *bgp, struct bgpevpn *vpn,
s, add ? ZEBRA_REMOTE_MACIP_ADD : ZEBRA_REMOTE_MACIP_DEL,
bgp->vrf_id);
stream_putl(s, vpn->vni);
- stream_put(s, &p->prefix.mac.octet, ETHER_ADDR_LEN); /* Mac Addr */
+ stream_put(s, &p->prefix.mac.octet, ETH_ALEN); /* Mac Addr */
/* IP address length and IP address, if any. */
if (IS_EVPN_PREFIX_IPADDR_NONE(p))
stream_putl(s, 0);
@@ -1812,9 +1812,9 @@ static int process_type2_route(struct peer *peer, afi_t afi, safi_t safi,
macaddr_len = *pfx++;
/* Get the MAC Addr */
- if (macaddr_len == (ETHER_ADDR_LEN * 8)) {
- memcpy(&p.prefix.mac.octet, pfx, ETHER_ADDR_LEN);
- pfx += ETHER_ADDR_LEN;
+ if (macaddr_len == (ETH_ALEN * 8)) {
+ memcpy(&p.prefix.mac.octet, pfx, ETH_ALEN);
+ pfx += ETH_ALEN;
} else {
zlog_err(
"%u:%s - Rx EVPN Type-2 NLRI with unsupported MAC address length %d",
@@ -2186,7 +2186,7 @@ char *bgp_evpn_route2str(struct prefix_evpn *p, char *buf, int len)
} else if (p->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE) {
if (IS_EVPN_PREFIX_IPADDR_NONE(p))
snprintf(buf, len, "[%d]:[0]:[0]:[%d]:[%s]",
- p->prefix.route_type, 8 * ETHER_ADDR_LEN,
+ p->prefix.route_type, 8 * ETH_ALEN,
prefix_mac2str(&p->prefix.mac, buf1,
sizeof(buf1)));
else {
@@ -2195,7 +2195,7 @@ char *bgp_evpn_route2str(struct prefix_evpn *p, char *buf, int len)
family = IS_EVPN_PREFIX_IPADDR_V4(p) ? AF_INET
: AF_INET6;
snprintf(buf, len, "[%d]:[0]:[0]:[%d]:[%s]:[%d]:[%s]",
- p->prefix.route_type, 8 * ETHER_ADDR_LEN,
+ p->prefix.route_type, 8 * ETH_ALEN,
prefix_mac2str(&p->prefix.mac, buf1,
sizeof(buf1)),
family == AF_INET ? IPV4_MAX_BITLEN
@@ -2237,7 +2237,7 @@ void bgp_evpn_encode_prefix(struct stream *s, struct prefix *p,
stream_put(s, prd->val, 8); /* RD */
stream_put(s, 0, 10); /* ESI */
stream_putl(s, 0); /* Ethernet Tag ID */
- stream_putc(s, 8 * ETHER_ADDR_LEN); /* Mac Addr Len - bits */
+ stream_putc(s, 8 * ETH_ALEN); /* Mac Addr Len - bits */
stream_put(s, evp->prefix.mac.octet, 6); /* Mac Addr */
stream_putc(s, 8 * ipa_len); /* IP address Length */
if (ipa_len)
diff --git a/bgpd/bgp_evpn_private.h b/bgpd/bgp_evpn_private.h
index 816a7df98..095dfa1b1 100644
--- a/bgpd/bgp_evpn_private.h
+++ b/bgpd/bgp_evpn_private.h
@@ -174,7 +174,7 @@ static inline void build_evpn_type2_prefix(struct prefix_evpn *p,
p->family = AF_ETHERNET;
p->prefixlen = EVPN_TYPE_2_ROUTE_PREFIXLEN;
p->prefix.route_type = BGP_EVPN_MAC_IP_ROUTE;
- memcpy(&p->prefix.mac.octet, mac->octet, ETHER_ADDR_LEN);
+ memcpy(&p->prefix.mac.octet, mac->octet, ETH_ALEN);
p->prefix.ip.ipa_type = IPADDR_NONE;
if (ip)
memcpy(&p->prefix.ip, ip, sizeof(*ip));
diff --git a/bgpd/bgp_rd.c b/bgpd/bgp_rd.c
index fd0169394..a15828bd3 100644
--- a/bgpd/bgp_rd.c
+++ b/bgpd/bgp_rd.c
@@ -98,7 +98,7 @@ void decode_rd_vnc_eth(u_char *pnt, struct rd_vnc_eth *rd_vnc_eth)
{
rd_vnc_eth->type = RD_TYPE_VNC_ETH;
rd_vnc_eth->local_nve_id = pnt[1];
- memcpy(rd_vnc_eth->macaddr.octet, pnt + 2, ETHER_ADDR_LEN);
+ memcpy(rd_vnc_eth->macaddr.octet, pnt + 2, ETH_ALEN);
}
#endif
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 1fb42f618..e4e421510 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -4775,7 +4775,7 @@ int bgp_static_set_safi(afi_t afi, safi_t safi, struct vty *vty,
}
if (routermac) {
bgp_static->router_mac =
- XCALLOC(MTYPE_ATTR, ETHER_ADDR_LEN + 1);
+ XCALLOC(MTYPE_ATTR, ETH_ALEN + 1);
prefix_str2mac(routermac,
bgp_static->router_mac);
}
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 4870e54ae..5071be909 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -2125,7 +2125,7 @@ static int bgp_zebra_process_local_macip(int command, struct zclient *zclient,
memset(&ip, 0, sizeof(ip));
s = zclient->ibuf;
vni = stream_getl(s);
- stream_get(&mac.octet, s, ETHER_ADDR_LEN);
+ stream_get(&mac.octet, s, ETH_ALEN);
ipa_len = stream_getl(s);
if (ipa_len != 0 && ipa_len != IPV4_MAX_BYTELEN
&& ipa_len != IPV6_MAX_BYTELEN) {
diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c
index ab71eda12..477716caf 100644
--- a/bgpd/rfapi/rfapi.c
+++ b/bgpd/rfapi/rfapi.c
@@ -1568,7 +1568,7 @@ rfapi_query_inner(void *handle, struct rfapi_ip_addr *target,
if (l2o) {
if (!memcmp(l2o->macaddr.octet, rfapi_ethaddr0.octet,
- ETHER_ADDR_LEN)) {
+ ETH_ALEN)) {
eth_is_0 = 1;
}
/* per t/c Paul/Lou 151022 */
@@ -3416,7 +3416,7 @@ DEFUN (debug_rfapi_query_vn_un_l2o,
/* construct option chain */
memset(valbuf, 0, sizeof(valbuf));
- memcpy(valbuf, &l2o_buf.macaddr.octet, ETHER_ADDR_LEN);
+ memcpy(valbuf, &l2o_buf.macaddr.octet, ETH_ALEN);
valbuf[11] = (l2o_buf.logical_net_id >> 16) & 0xff;
valbuf[12] = (l2o_buf.logical_net_id >> 8) & 0xff;
valbuf[13] = l2o_buf.logical_net_id & 0xff;
diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c
index 61739d38a..7e0ed9150 100644
--- a/bgpd/rfapi/rfapi_import.c
+++ b/bgpd/rfapi/rfapi_import.c
@@ -308,7 +308,7 @@ int rfapiGetL2o(struct attr *attr, struct rfapi_l2address_option *l2o)
if (pEncap->value[1] == 14) {
memcpy(l2o->macaddr.octet,
pEncap->value + 2,
- ETHER_ADDR_LEN);
+ ETH_ALEN);
l2o->label =
((pEncap->value[10]
>> 4)
@@ -1327,7 +1327,7 @@ rfapiRouteInfo2NextHopEntry(struct rfapi_ip_prefix *rprefix,
vo->type = RFAPI_VN_OPTION_TYPE_L2ADDR;
memcpy(&vo->v.l2addr.macaddr, &rn->p.u.prefix_eth.octet,
- ETHER_ADDR_LEN);
+ ETH_ALEN);
/* only low 3 bytes of this are significant */
if (bi->attr) {
(void)rfapiEcommunityGetLNI(
diff --git a/bgpd/rfapi/rfapi_monitor.c b/bgpd/rfapi/rfapi_monitor.c
index 9c0d9da6f..6a7595443 100644
--- a/bgpd/rfapi/rfapi_monitor.c
+++ b/bgpd/rfapi/rfapi_monitor.c
@@ -805,7 +805,7 @@ void rfapiMonitorTimersRestart(struct rfapi_descriptor *rfd, struct prefix *p)
(void **)&mon_eth, &cursor)) {
if (!memcmp(mon_eth->macaddr.octet,
- p->u.prefix_eth.octet, ETHER_ADDR_LEN)) {
+ p->u.prefix_eth.octet, ETH_ALEN)) {
rfapiMonitorEthTimerRestart(mon_eth);
}
@@ -1117,7 +1117,7 @@ static int mon_eth_cmp(void *a, void *b)
/*
* compare ethernet addresses
*/
- for (i = 0; i < ETHER_ADDR_LEN; ++i) {
+ for (i = 0; i < ETH_ALEN; ++i) {
if (m1->macaddr.octet[i] != m2->macaddr.octet[i])
return (m1->macaddr.octet[i] - m2->macaddr.octet[i]);
}
diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c
index 791eb4c91..748c0c476 100644
--- a/bgpd/rfapi/rfapi_rib.c
+++ b/bgpd/rfapi/rfapi_rib.c
@@ -687,7 +687,7 @@ static void rfapiRibBi2Ri(struct bgp_info *bi, struct rfapi_info *ri,
/* copy from RD already stored in bi, so we don't need it_node
*/
memcpy(&vo->v.l2addr.macaddr, bi->extra->vnc.import.rd.val + 2,
- ETHER_ADDR_LEN);
+ ETH_ALEN);
if (bi->attr) {
(void)rfapiEcommunityGetLNI(
diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c
index 98c3decbd..e7314d298 100644
--- a/bgpd/rfapi/rfapi_vty.c
+++ b/bgpd/rfapi/rfapi_vty.c
@@ -3092,7 +3092,7 @@ static int rfapiDeleteLocalPrefixesByRFD(struct rfapi_local_reg_delete_arg *cda,
if (memcmp(cda->l2o.o.macaddr.octet,
adb->u.s.prefix_eth.u
.prefix_eth.octet,
- ETHER_ADDR_LEN)) {
+ ETH_ALEN)) {
#if DEBUG_L2_EXTRA
vnc_zlog_debug_verbose(
"%s: adb=%p, macaddr doesn't match, skipping",
@@ -3211,7 +3211,7 @@ static int rfapiDeleteLocalPrefixesByRFD(struct rfapi_local_reg_delete_arg *cda,
adb->u.s.prefix_eth.u
.prefix_eth
.octet,
- ETHER_ADDR_LEN)) {
+ ETH_ALEN)) {
continue;
}