40 #include <linux/module.h>
41 #include <linux/types.h>
42 #include <linux/kernel.h>
43 #include <linux/string.h>
45 #include <linux/socket.h>
49 #include <linux/netdevice.h>
52 #include <linux/errno.h>
54 #include <linux/if_ether.h>
61 #include <asm/uaccess.h>
80 const void *
daddr,
const void *
saddr,
unsigned int len)
137 "%s: unable to resolve type %X addresses.\n",
162 skb_reset_mac_header(skb);
193 if (netdev_uses_dsa_tags(dev))
195 if (netdev_uses_trailer_tags(dev))
207 if (skb->
len >= 2 && *(
unsigned short *)(skb->
data) == 0xFFFF)
224 const struct ethhdr *eth = eth_hdr(skb);
267 const unsigned char *haddr)
290 if (!is_valid_ether_addr(addr->
sa_data))
318 if (!is_valid_ether_addr(dev->
dev_addr))
377 static size_t _format_mac_addr(
char *
buf,
int buflen,
378 const unsigned char *
addr,
int len)
383 for (i = 0; i < len; i++) {
384 cp +=
scnprintf(cp, buflen - (cp - buf),
"%02x", addr[i]);
387 cp +=
scnprintf(cp, buflen - (cp - buf),
":");
396 l = _format_mac_addr(buf,
PAGE_SIZE, addr, len);