From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Backport dev_hw_addr_random
Date: Sun, 12 Feb 2012 14:35:30 +0100 [thread overview]
Message-ID: <1329053731-4737-2-git-send-email-sven@narfation.org> (raw)
In-Reply-To: <1329053731-4737-1-git-send-email-sven@narfation.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 <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
next prev parent reply other threads:[~2012-02-12 13:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2012-02-12 14:01 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Backport dev_hw_addr_random 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1329053731-4737-2-git-send-email-sven@narfation.org \
--to=sven@narfation.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox