Dan Carpenter dan.carpenter@oracle.com
Dan Wendlandt dan@nicira.com
Daniel Roman droman@nicira.com
+Danny Kukawka danny.kukawka@bisect.de
David Erickson derickso@stanford.edu
Devendra Naga devendra.aaru@gmail.com
Dominic Curran dominic.curran@citrix.com
linux/compat/include/linux/cpumask.h \
linux/compat/include/linux/dmi.h \
linux/compat/include/linux/err.h \
+ linux/compat/include/linux/etherdevice.h \
linux/compat/include/linux/flex_array.h \
linux/compat/include/linux/genetlink.h \
linux/compat/include/linux/icmp.h \
--- /dev/null
+#ifndef __LINUX_ETHERDEVICE_WRAPPER_H
+#define __LINUX_ETHERDEVICE_WRAPPER_H 1
+
+#include_next <linux/etherdevice.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+static inline void eth_hw_addr_random(struct net_device *dev)
+{
+ random_ether_addr(dev->dev_addr);
+}
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+static inline void eth_hw_addr_random(struct net_device *dev)
+{
+ dev_hw_addr_random(dev, dev->dev_addr);
+}
+#endif
+
+#endif
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
+#ifdef NET_ADDR_RANDOM
+ dev->addr_assign_type &= ~NET_ADDR_RANDOM;
+#endif
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
return 0;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
netdev->hw_features = netdev->features & ~NETIF_F_LLTX;
#endif
- random_ether_addr(netdev->dev_addr);
+ eth_hw_addr_random(netdev);
}
static struct vport *internal_dev_create(const struct vport_parms *parms)