b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Remove useless branch for NET_ADDR_RANDOM
@ 2012-02-12 13:35 Sven Eckelmann
  2012-02-12 13:35 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Backport dev_hw_addr_random Sven Eckelmann
  2012-02-12 13:48 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Remove useless branch for NET_ADDR_RANDOM Marek Lindner
  0 siblings, 2 replies; 4+ messages in thread
From: Sven Eckelmann @ 2012-02-12 13:35 UTC (permalink / raw)
  To: b.a.t.m.a.n

910ccacb9dd2bfac8ce1ac411af514fe72fa84c0 introduced a branch for a statement
that doesn't need it.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 soft-interface.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/soft-interface.c b/soft-interface.c
index 0087052..3750e9b 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -108,8 +108,7 @@ static int interface_set_mac_addr(struct net_device *dev, void *p)
 	}
 
 	memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
-	if (dev->addr_assign_type & NET_ADDR_RANDOM)
-		dev->addr_assign_type &= ~NET_ADDR_RANDOM;
+	dev->addr_assign_type &= ~NET_ADDR_RANDOM;
 
 	return 0;
 }
-- 
1.7.9


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Backport dev_hw_addr_random
  2012-02-12 13:35 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Remove useless branch for NET_ADDR_RANDOM Sven Eckelmann
@ 2012-02-12 13:35 ` Sven Eckelmann
  2012-02-12 14:01   ` Marek Lindner
  2012-02-12 13:48 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Remove useless branch for NET_ADDR_RANDOM Marek Lindner
  1 sibling, 1 reply; 4+ messages in thread
From: Sven Eckelmann @ 2012-02-12 13:35 UTC (permalink / raw)
  To: b.a.t.m.a.n

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 <sven@narfation.org>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Remove useless branch for NET_ADDR_RANDOM
  2012-02-12 13:35 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Remove useless branch for NET_ADDR_RANDOM Sven Eckelmann
  2012-02-12 13:35 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Backport dev_hw_addr_random Sven Eckelmann
@ 2012-02-12 13:48 ` Marek Lindner
  1 sibling, 0 replies; 4+ messages in thread
From: Marek Lindner @ 2012-02-12 13:48 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Sunday, February 12, 2012 21:35:29 Sven Eckelmann wrote:
> 910ccacb9dd2bfac8ce1ac411af514fe72fa84c0 introduced a branch for a
> statement that doesn't need it.

Applied in revision 8e2c2d3.

Thanks,
Marek

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Backport dev_hw_addr_random
  2012-02-12 13:35 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Backport dev_hw_addr_random Sven Eckelmann
@ 2012-02-12 14:01   ` Marek Lindner
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Lindner @ 2012-02-12 14:01 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Sunday, February 12, 2012 21:35:30 Sven Eckelmann wrote:
> 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.

Applied in revision f86649b.

Thanks,
Marek

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-12 14:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-12 13:35 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Remove useless branch for NET_ADDR_RANDOM Sven Eckelmann
2012-02-12 13:35 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Backport dev_hw_addr_random Sven Eckelmann
2012-02-12 14:01   ` Marek Lindner
2012-02-12 13:48 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Remove useless branch for NET_ADDR_RANDOM Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).