From patchwork Sun Mar 3 18:25:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17850 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 36B94820F6; Sun, 3 Mar 2019 19:25:39 +0100 (CET) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="AiACiLSd"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2001:4d88:2000:7::2; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [IPv6:2001:4d88:2000:7::2]) by open-mesh.org (Postfix) with ESMTPS id 414818040C for ; Sun, 3 Mar 2019 19:25:37 +0100 (CET) Received: from sven-desktop.home.narfation.org (p200300C5974904FD0000000000004065.dip0.t-ipconnect.de [IPv6:2003:c5:9749:4fd::4065]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 67B4211010E; Sun, 3 Mar 2019 19:25:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1551637537; bh=OXbM4oEyW9a553Ks3tMFfp0J1L4hLU7b726UAKUzREo=; h=From:To:Cc:Subject:Date:From; b=AiACiLSddfvIZ69I3Qol/8O2ZPJtpBTgYQSrslOuAsmGZG0zzAi/RnABH1ZBQudND y5G5JGh4Mtu1M1f5Nmf60MZXIK6VxaGMHY0QNMkdshrSAFrHVkLeS6IzR3um1XYRUe b3rQ40Wvy0KkFdrGPokm64R3oyG49IWdAyagqs0k= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 3 Mar 2019 19:25:26 +0100 Message-Id: <20190303182526.925-1-sven@narfation.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Fix genl notification for throughput_override X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" 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 --- 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); + } out: batadv_hardif_put(hard_iface);