X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=datapath%2Flinux%2Fcompat%2Finclude%2Flinux%2Fetherdevice.h;fp=datapath%2Flinux%2Fcompat%2Finclude%2Flinux%2Fetherdevice.h;h=7a8178e5b8c9759aa1cc3b45f36d685cd7d1722d;hb=550534413c31d7c91181305962fc7fc982465ac0;hp=0000000000000000000000000000000000000000;hpb=0e553d9c1063be047824c6f1afce9ffc6db6c671;p=sliver-openvswitch.git diff --git a/datapath/linux/compat/include/linux/etherdevice.h b/datapath/linux/compat/include/linux/etherdevice.h new file mode 100644 index 000000000..7a8178e5b --- /dev/null +++ b/datapath/linux/compat/include/linux/etherdevice.h @@ -0,0 +1,19 @@ +#ifndef __LINUX_ETHERDEVICE_WRAPPER_H +#define __LINUX_ETHERDEVICE_WRAPPER_H 1 + +#include_next +#include + +#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