Commit e5a727f6632654098fa4e87d8551a5873e8f658a

Authored by Joe Perches
Committed by David S. Miller
1 parent e8b39015b5

bridge: Use ether_addr_copy and ETH_ALEN

Convert the more obvious uses of memcpy to ether_addr_copy.

There are still uses of memcpy that could be converted but
these addresses are __aligned(2).

Convert a couple uses of 6 in gr_private.h to ETH_ALEN.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 3 changed files with 5 additions and 5 deletions Side-by-side Diff

net/bridge/br_device.c
... ... @@ -367,7 +367,7 @@
367 367 br->bridge_id.prio[0] = 0x80;
368 368 br->bridge_id.prio[1] = 0x00;
369 369  
370   - memcpy(br->group_addr, eth_reserved_addr_base, ETH_ALEN);
  370 + ether_addr_copy(br->group_addr, eth_reserved_addr_base);
371 371  
372 372 br->stp_enabled = BR_NO_STP;
373 373 br->group_fwd_mask = BR_GROUPFWD_DEFAULT;
net/bridge/br_multicast.c
... ... @@ -363,7 +363,7 @@
363 363 skb_reset_mac_header(skb);
364 364 eth = eth_hdr(skb);
365 365  
366   - memcpy(eth->h_source, br->dev->dev_addr, ETH_ALEN);
  366 + ether_addr_copy(eth->h_source, br->dev->dev_addr);
367 367 eth->h_dest[0] = 1;
368 368 eth->h_dest[1] = 0;
369 369 eth->h_dest[2] = 0x5e;
... ... @@ -433,7 +433,7 @@
433 433 skb_reset_mac_header(skb);
434 434 eth = eth_hdr(skb);
435 435  
436   - memcpy(eth->h_source, br->dev->dev_addr, ETH_ALEN);
  436 + ether_addr_copy(eth->h_source, br->dev->dev_addr);
437 437 eth->h_proto = htons(ETH_P_IPV6);
438 438 skb_put(skb, sizeof(*eth));
439 439  
net/bridge/br_private.h
... ... @@ -46,12 +46,12 @@
46 46 struct bridge_id
47 47 {
48 48 unsigned char prio[2];
49   - unsigned char addr[6];
  49 + unsigned char addr[ETH_ALEN];
50 50 };
51 51  
52 52 struct mac_addr
53 53 {
54   - unsigned char addr[6];
  54 + unsigned char addr[ETH_ALEN];
55 55 };
56 56  
57 57 struct br_ip