From: Christof Schulze <christof.schulze@gmx.net>
To: siwu@hrz.tu-chemnitz.de, b a t m a n <b.a.t.m.a.n@lists.open-mesh.org>
Cc: info@wifi-frankfurt.de, thomas@t-8ch.de
Subject: [B.A.T.M.A.N.] Batman-advanced-dkms + debian + kernel >4.1
Date: Sun, 04 Oct 2015 16:24:11 +0200 [thread overview]
Message-ID: <37028290.5tXI0TbgDB@lappi> (raw)
Hello Simon,
when trying to run batman v14 on a current kernel (I noticed it for Version
4.1) I realized that batman will not build beause the netdev-structs
have changed.
The solution is fairly simple because the fix has already been
implemented in newer batman versions. The function
batadv_is_on_batman_iface can be copied from there and is working fine.
I am running a system with kernel 4.1 that was patched in this manner
and it has been working fine in a large mesh (Freifunk Frankfurt am
Main) for a week.
The patch should work well for older kernels too because the
netdev-changes have been there for quite a while.
Now: Where is the correct place to implement the patch: in
batman-adv-dkms or in batman itself?
Regards
Christof
--- hard-interface.c-orig 2015-09-25 09:58:07.123947197 +0200
+++ hard-interface.c 2015-09-25 10:04:34.611914938 +0200
@@ -74,29 +74,28 @@
* if it is a batman-adv interface itself), false otherwise
*/
static bool batadv_is_on_batman_iface(const struct net_device *net_dev)
-{
- struct net_device *parent_dev;
- bool ret;
+{
+ struct net_device *parent_dev;
+ bool ret;
+
+ /* check if this is a batman-adv mesh interface */
+ if (batadv_softif_is_valid(net_dev))
+ return true;
+
+ /* no more parents..stop recursion */
+ if (dev_get_iflink(net_dev) == 0 ||
+ dev_get_iflink(net_dev) == net_dev->ifindex)
+ return false;
+
+ /* recurse over the parent device */
+ parent_dev = __dev_get_by_index(&init_net, dev_get_iflink(net_dev));
+ /* if we got a NULL parent_dev there is something broken.. */
+ if (WARN(!parent_dev, "Cannot find parent device"))
+ return false;
- /* check if this is a batman-adv mesh interface */
- if (batadv_softif_is_valid(net_dev))
- return true;
+ ret = batadv_is_on_batman_iface(parent_dev);
- /* no more parents..stop recursion */
- if (net_dev->iflink == net_dev->ifindex)
- return false;
-
- /* recurse over the parent device */
- parent_dev = dev_get_by_index(&init_net, net_dev->iflink);
- /* if we got a NULL parent_dev there is something broken.. */
- if (WARN(!parent_dev, "Cannot find parent device"))
- return false;
-
- ret = batadv_is_on_batman_iface(parent_dev);
-
- if (parent_dev)
- dev_put(parent_dev);
- return ret;
+ return ret;
}
static int batadv_is_valid_iface(const struct net_device *net_dev)
--
() ascii ribbon campaign - against html e-mail
/\ against proprietary attachments
next reply other threads:[~2015-10-04 14:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-04 14:24 Christof Schulze [this message]
2015-10-04 16:41 ` [B.A.T.M.A.N.] Batman-advanced-dkms + debian + kernel >4.1 Sven Eckelmann
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=37028290.5tXI0TbgDB@lappi \
--to=christof.schulze@gmx.net \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=info@wifi-frankfurt.de \
--cc=siwu@hrz.tu-chemnitz.de \
--cc=thomas@t-8ch.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