From patchwork Mon Oct 9 15:33:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17100 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 736E882043; Mon, 9 Oct 2017 17:33:17 +0200 (CEST) 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="jRXfM9M2"; 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 6F3DB8033F for ; Mon, 9 Oct 2017 17:33:12 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p2003007C6F4D0EFE81F09946C9127996.dip0.t-ipconnect.de [IPv6:2003:7c:6f4d:efe:81f0:9946:c912:7996]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id F3F1B1100FB; Mon, 9 Oct 2017 17:33:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1507563192; bh=4tyC/mPBrsIuAZmqfxUTA5BEcPGala32CS1zFmHdxTA=; h=From:To:Cc:Subject:Date:From; b=jRXfM9M2gi30idCRsoYoQGkBGBWeYE0+exHKLuXcbm3KENTFyuSQzmlISKTAO1KR+ Zwl8d2EovBJSkdCrFYOqs2p+mls3uGK31A0CM3MUmLF0wcD4EsRjTHPmYETZLu9CSf 9ah6YPg3hBI8NAqahcPexfPdvzgVYDYQM4qaR/s0= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Mon, 9 Oct 2017 17:33:06 +0200 Message-Id: <20171009153307.29245-1-sven@narfation.org> X-Mailer: git-send-email 2.11.0 Subject: [B.A.T.M.A.N.] [PATCH 1/2] alfred: Only query debugfs when netlink failed 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" It is enough to just request the data from netlink and skip debugfs when netlink didn't return an error. The overwrite of the ret variable was only for testing purposes and should no longer be used. Fixes: a7bc3d9a2b3f ("alfred: Cache the global translation table entries") Signed-off-by: Sven Eckelmann --- batadv_query.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/batadv_query.c b/batadv_query.c index 8580f1b..78b92cd 100644 --- a/batadv_query.c +++ b/batadv_query.c @@ -308,7 +308,6 @@ struct hashtable_t *tg_hash_new(const char *mesh_iface) ret = translate_mac_netlink(mesh_iface, tg_hash); enable_net_admin_capability(0); - ret = -EOPNOTSUPP; if (ret == -EOPNOTSUPP) translate_mac_debugfs(mesh_iface, tg_hash); @@ -477,7 +476,6 @@ struct hashtable_t *orig_hash_new(const char *mesh_iface) ret = get_tq_netlink(mesh_iface, orig_hash); enable_net_admin_capability(0); - ret = -EOPNOTSUPP; if (ret == -EOPNOTSUPP) get_tq_debugfs(mesh_iface, orig_hash);