From d0f07d08465fc6cf771bb2d20e6c4742fa31dd39 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 15 Apr 2013 22:47:38 +0200 Subject: [PATCH] backports: protect eth_hw_addr_random with LINUX_BACKPORT debian kernel 3.2 backports eth_hw_addr_random and this collides with our backport without this patch. Signed-off-by: Hauke Mehrtens Signed-off-by: Johannes Berg --- backport/backport-include/linux/etherdevice.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h index 03208b641b84..fc6803fe04ca 100644 --- a/backport/backport-include/linux/etherdevice.h +++ b/backport/backport-include/linux/etherdevice.h @@ -4,11 +4,13 @@ #include #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) +#define eth_hw_addr_random LINUX_BACKPORT(eth_hw_addr_random) static inline void eth_hw_addr_random(struct net_device *dev) { #error eth_hw_addr_random() needs to be implemented for < 2.6.12 } #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) +#define eth_hw_addr_random LINUX_BACKPORT(eth_hw_addr_random) static inline void eth_hw_addr_random(struct net_device *dev) { get_random_bytes(dev->dev_addr, ETH_ALEN); @@ -23,12 +25,14 @@ static inline void eth_hw_addr_random(struct net_device *dev) #define NET_ADDR_RANDOM 1 /* address is generated randomly */ #define NET_ADDR_STOLEN 2 /* address is stolen from other device */ +#define eth_hw_addr_random LINUX_BACKPORT(eth_hw_addr_random) static inline void eth_hw_addr_random(struct net_device *dev) { random_ether_addr(dev->dev_addr); } #elif LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) +#define eth_hw_addr_random LINUX_BACKPORT(eth_hw_addr_random) static inline void eth_hw_addr_random(struct net_device *dev) { dev_hw_addr_random(dev, dev->dev_addr); -- 2.30.2