[commits] [batman-adv] master: batman-adv: Fix genl notification for throughput_override (d9790b4c)

postmaster at open-mesh.org postmaster at open-mesh.org
Tue Mar 5 22:54:35 CET 2019

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

On branch  : master


commit d9790b4c1bfe8e8603eb84ae550f2e1716aa7db8
Author: Sven Eckelmann <sven at narfation.org>
Date:   Sun Mar 3 19:25:26 2019 +0100

    batman-adv: Fix genl notification for throughput_override
    The throughput_override sysfs file is not below the meshif but below a
    hardif. The kobj has therefore not a pointer which can be used to find the
    batadv_priv data. The pointer stored in the hardif object must be used
    instead to find the correct meshif private data.
    Fixes: 68e981a3a261 ("batman-adv: Trigger genl notification on sysfs config change")
    Signed-off-by: Sven Eckelmann <sven at narfation.org>


 net/batman-adv/sysfs.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c
index 0b4b3fb7..208655cf 100644
--- a/net/batman-adv/sysfs.c
+++ b/net/batman-adv/sysfs.c
@@ -1116,9 +1116,9 @@ static ssize_t batadv_store_throughput_override(struct kobject *kobj,
 						struct attribute *attr,
 						char *buff, size_t count)
-	struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj);
 	struct net_device *net_dev = batadv_kobj_to_netdev(kobj);
 	struct batadv_hard_iface *hard_iface;
+	struct batadv_priv *bat_priv;
 	u32 tp_override;
 	u32 old_tp_override;
 	bool ret;
@@ -1147,7 +1147,10 @@ static ssize_t batadv_store_throughput_override(struct kobject *kobj,
 	atomic_set(&hard_iface->bat_v.throughput_override, tp_override);
-	batadv_netlink_notify_hardif(bat_priv, hard_iface);
+	if (hard_iface->soft_iface) {
+		bat_priv = netdev_priv(hard_iface->soft_iface);
+		batadv_netlink_notify_hardif(bat_priv, hard_iface);
+	}

More information about the commits mailing list