[commits] [batman-adv] maint: batman-adv: ignore netdev_set_master() calls on kernels older than 2.6.39 (7d28d37)

postmaster at open-mesh.org postmaster at open-mesh.org
Mon Apr 20 05:08:41 CEST 2015


Repository : ssh://git@open-mesh.org/batman-adv

On branch  : maint

>---------------------------------------------------------------

commit 7d28d37061fe1ce8866e84a14806a92a5d3abf11
Author: Marek Lindner <mareklindner at neomailbox.ch>
Date:   Thu Feb 19 12:03:39 2015 +0800

    batman-adv: ignore netdev_set_master() calls on kernels older than 2.6.39
    
    batman-adv calls netdev_master_upper_dev_link() which is replaced with with
    netdev_set_master() for kernels older than 3.9 via compat.h.
    Prior to 2.6.39 netdev_set_master() contained Linux bonding calls needed to
    setup bonding devices. Calling this function from batman-adv leads to
    unexpected behavior when current batman-adv versions are used on these
    older kernels.
    
    To fix the situation compat.h now ships its own implementation of
    netdev_set_master() which does not change the net_dev->master state
    on kernels older than 2.6.39.
    
    Reported-by: Andreas Pape <APape at phoenixcontact.com>
    Signed-off-by: Marek Lindner <mareklindner at neomailbox.ch>


>---------------------------------------------------------------

7d28d37061fe1ce8866e84a14806a92a5d3abf11
 compat.h |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/compat.h b/compat.h
index d3db201..f9a12fc 100644
--- a/compat.h
+++ b/compat.h
@@ -191,6 +191,15 @@ static inline int batadv_param_set_copystring(const char *val,
 #define kstrtoul strict_strtoul
 #define kstrtol  strict_strtol
 
+/* On older kernels net_dev->master is reserved for iface bonding. */
+static inline int batadv_netdev_set_master(struct net_device *slave,
+					   struct net_device *master)
+{
+	return 0;
+}
+
+#define netdev_set_master batadv_netdev_set_master
+
 /* Hack for removing ndo_add/del_slave at the end of net_device_ops.
  * This is somewhat ugly because it requires that ndo_validate_addr
  * is at the end of this struct in soft-interface.c.



More information about the commits mailing list