From: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: fix NET_ADDR_RANDOM usage for pre-3.9 kernel
Date: Tue, 8 Jan 2013 15:23:04 +0100 [thread overview]
Message-ID: <1357654984-19098-1-git-send-email-siwu@hrz.tu-chemnitz.de> (raw)
Kernel before 3.9 have the NET_ADDR_RANDOM flag which needs to be set.
This patch adds the necessary compat change for older kernel.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
compat.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
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_ */
--
1.7.10.4
next reply other threads:[~2013-01-08 14:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-08 14:23 Simon Wunderlich [this message]
2013-01-09 7:24 ` [B.A.T.M.A.N.] [PATCH] batman-adv: fix NET_ADDR_RANDOM usage for pre-3.9 kernel 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=1357654984-19098-1-git-send-email-siwu@hrz.tu-chemnitz.de \
--to=simon.wunderlich@s2003.tu-chemnitz.de \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=siwu@hrz.tu-chemnitz.de \
/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;
as well as URLs for NNTP newsgroup(s).