Return-Path: From: Sven Eckelmann Date: Sun, 12 Feb 2012 14:35:30 +0100 Message-Id: <1329053731-4737-2-git-send-email-sven@narfation.org> In-Reply-To: <1329053731-4737-1-git-send-email-sven@narfation.org> References: <1329053731-4737-1-git-send-email-sven@narfation.org> Subject: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Backport dev_hw_addr_random Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: b.a.t.m.a.n@lists.open-mesh.org 910ccacb9dd2bfac8ce1ac411af514fe72fa84c0 introduced the hardware address initialization using dev_hw_addr_random. This function was added to linux with linux 2.6.36. Older kernel versions have to igore the NET_ADDR_RANDOM variable and use random_ether_addr directly. Signed-off-by: Sven Eckelmann --- compat.h | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/compat.h b/compat.h index e90409f..88866da 100644 --- a/compat.h +++ b/compat.h @@ -104,6 +104,15 @@ static inline int __param_set_copystring(const char *val, } #define param_set_copystring __param_set_copystring +static inline void dev_hw_addr_random(struct net_device *dev, u8 *hwaddr) +{ + random_ether_addr(hwaddr); +} + +/* hack for dev->addr_assign_type &= ~NET_ADDR_RANDOM; */ +#define addr_assign_type ifindex +#define NET_ADDR_RANDOM 0 + #endif /* < KERNEL_VERSION(2, 6, 36) */ -- 1.7.9