To be merged with ("batman-adv: Allow to modify slaves of soft-interfaces
through rntl_link")

Signed-off-by: Antonio Quartulli <[email protected]>
---

Sven: I think this is enough to account the correct "master" setting? In 
net-next it
is now called upper_device and they also changed some api. Therefore a compat
solution is also provided.

Cheers,

 compat.h         | 2 ++
 hard-interface.c | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/compat.h b/compat.h
index e21b310..e5807d7 100644
--- a/compat.h
+++ b/compat.h
@@ -211,6 +211,8 @@ static int batadv_interface_set_mac_addr(struct net_device 
*dev, void *p) \
 }\
 static int __batadv_interface_set_mac_addr(x, y)
 
+#define netdev_master_upper_dev_link netdev_set_master
+
 #endif /* < KERNEL_VERSION(3, 9, 0) */
 
 #endif /* _NET_BATMAN_ADV_COMPAT_H_ */
diff --git a/hard-interface.c b/hard-interface.c
index 6c32607..bbc6188 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -313,7 +313,7 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface 
*hard_iface,
        struct batadv_priv *bat_priv;
        struct net_device *soft_iface;
        __be16 ethertype = __constant_htons(ETH_P_BATMAN);
-       int ret;
+       int ret = 0;
 
        if (hard_iface->if_status != BATADV_IF_NOT_IN_USE)
                goto out;
@@ -398,6 +398,10 @@ int batadv_hardif_enable_interface(struct 
batadv_hard_iface *hard_iface,
        /* begin scheduling originator messages on that interface */
        batadv_schedule_bat_ogm(hard_iface);
 
+       ret = netdev_master_upper_dev_link(hard_iface->net_dev, soft_iface);
+       if (ret)
+               goto err_dev;
+
 out:
        return 0;
 
-- 
1.8.1.2

Reply via email to