Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
commit dfb46497a3a26526c6d3c0e16c477b2bad231ada Author: Jiri Pirko jiri@resnulli.us Date: Wed Jan 9 14:50:21 2013 +0800
batman-adv: remove unnecessary NET_ADDR_RANDOM "bitclean"
NET_ADDR_SET is set in dev_set_mac_address() no need to alter dev->addr_assign_type value in drivers.
Signed-off-by: Jiri Pirko jiri@resnulli.us Signed-off-by: David S. Miller davem@davemloft.net Signed-off-by: Simon Wunderlich siwu@hrz.tu-chemnitz.de Signed-off-by: Marek Lindner lindner_marek@yahoo.de
dfb46497a3a26526c6d3c0e16c477b2bad231ada compat.h | 13 +++++++++++++ soft-interface.c | 1 - 2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/compat.h b/compat.h index 3d03a2f..e21b310 100644 --- a/compat.h +++ b/compat.h @@ -198,6 +198,19 @@ static inline void eth_hw_addr_random(struct net_device *dev)
#define prandom_u32() random32()
+#define batadv_interface_set_mac_addr(x, y) \ +__batadv_interface_set_mac_addr(struct net_device *dev, void *p);\ +static int batadv_interface_set_mac_addr(struct net_device *dev, void *p) \ +{\ + int ret;\ +\ + ret = __batadv_interface_set_mac_addr(dev, p);\ + if (!ret) \ + dev->addr_assign_type &= ~NET_ADDR_RANDOM;\ + return ret;\ +}\ +static int __batadv_interface_set_mac_addr(x, y) + #endif /* < KERNEL_VERSION(3, 9, 0) */
#endif /* _NET_BATMAN_ADV_COMPAT_H_ */ diff --git a/soft-interface.c b/soft-interface.c index 9927afa..dbbf2b6 100644 --- a/soft-interface.c +++ b/soft-interface.c @@ -124,7 +124,6 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p) batadv_tt_local_add(dev, addr->sa_data, BATADV_NULL_IFINDEX); }
- dev->addr_assign_type &= ~NET_ADDR_RANDOM; return 0; }