aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/soft-interface.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2021-06-01 23:50:35 +0200
committerSimon Wunderlich <sw@simonwunderlich.de>2021-06-02 22:25:45 +0200
commitfa205602d46e0b66c0c90672bce8b36e5de449df (patch)
tree6d788897d8f118e1f52ba53d67d2a57d8166b544 /net/batman-adv/soft-interface.c
parentbatman-adv: Drop implicit creation of batadv net_devices (diff)
downloadlinux-dev-fa205602d46e0b66c0c90672bce8b36e5de449df.tar.xz
linux-dev-fa205602d46e0b66c0c90672bce8b36e5de449df.zip
batman-adv: Avoid name based attaching of hard interfaces
The sysfs code for the batman-adv/mesh_iface file was receiving a string of the batadv interface. This interface name was then provided to the code which shared sysfs+rtnetlink code for attaching an hard-interface to an batadv interface. The rtnetlink code was also using the (extracted) interface name from the ndo_add_slave callback to increase the shared code - even when it would have been more efficient to use the provided net_device object directly instead of searching it again (based on its name) in batadv_hardif_enable_interface. But this indirect handling is no longer necessary because the sysfs code was dropped. There is now only a single code path which is using batadv_hardif_enable_interface. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/soft-interface.c')
-rw-r--r--net/batman-adv/soft-interface.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 0c5b34251a6d..ae368a42a4ad 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -842,14 +842,13 @@ static int batadv_softif_slave_add(struct net_device *dev,
struct netlink_ext_ack *extack)
{
struct batadv_hard_iface *hard_iface;
- struct net *net = dev_net(dev);
int ret = -EINVAL;
hard_iface = batadv_hardif_get_by_netdev(slave_dev);
if (!hard_iface || hard_iface->soft_iface)
goto out;
- ret = batadv_hardif_enable_interface(hard_iface, net, dev->name);
+ ret = batadv_hardif_enable_interface(hard_iface, dev);
out:
if (hard_iface)