From patchwork Fri Dec 7 21:46:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17712 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 129B481137; Fri, 7 Dec 2018 22:46:52 +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="r2p57OpZ"; 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 A1D31810E5 for ; Fri, 7 Dec 2018 22:46:50 +0100 (CET) Received: from sven-desktop.home.narfation.org (p200300C5970891FD0000000000008096.dip0.t-ipconnect.de [IPv6:2003:c5:9708:91fd::8096]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id CAE411100D6; Fri, 7 Dec 2018 22:46:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1544219210; bh=Q6g7LTAYI5iJgoZ1l/5VGzi71pdvDlUDe5mM+dqJuI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r2p57OpZv/zjMjUx1cwtRoYd4qhepEP2+75cdfzJIktL4fjb7tDJulipg2hC2Jm3v 9smpE/rJ5YpYEOASuqKgWbOPvqgN2YrfbO6pNvZ0rCKQWzE7DR0trjJYLq5YHHfI5M xB9wogfE+CxjEQbbBxmCxJP0JBTe4XWyDj1xnFB8= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Fri, 7 Dec 2018 22:46:29 +0100 Message-Id: <20181207214629.30307-2-sven@narfation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181207214629.30307-1-sven@narfation.org> References: <20181207214629.30307-1-sven@narfation.org> MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH 2/2] batctl: Drop incorrect check for existing meshif directory 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 (not silenced) read_file/write_file functions will check whether the directory of a file exists. This is used to determine whether the mesh interface was created. In that case, it will print: Error - mesh has not been enabled yet Activate your mesh by adding interfaces to batman-adv This is most of the time wrong because only a limited number of commands will call these function: * gw_mode * log * loglevel * routing_algo * backbonetable * claimtable * dat_cache * gateways * mcast_flags * nc_nodes * neighbors * originators * transglobal * translocal Beside routing_algo, every command is marked as COMMAND_FLAG_MESH_IFACE and therefore already requested a check to make sure that the specified meshif existed at some point. This message is especially confusing because debugfs can be disabled in batman-adv. If it was compiled without debugfs and the user tries to still use `batctl log`, the log command will fail with an incorrect error message instead of showing a more detailed (and more correct): Error - can't open file '/sys/kernel/debug//batman_adv/bat0/log': No such file or directory The option you called seems not to be compiled into your batman-adv kernel module. Consult the README if you wish to learn more about compiling options into batman-adv. And for routing_algo, the problem of the missing batman-adv module should already be catched when the batman-adv module version path is checked. Reported-by: Andre Kasper Signed-off-by: Sven Eckelmann --- functions.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/functions.c b/functions.c index 9a130e1..9d64c62 100644 --- a/functions.c +++ b/functions.c @@ -149,12 +149,6 @@ static void file_open_problem_dbg(const char *dir, const char *full_path) return; } - if (!file_exists(dir)) { - fprintf(stderr, "Error - mesh has not been enabled yet\n"); - fprintf(stderr, "Activate your mesh by adding interfaces to batman-adv\n"); - return; - } - fprintf(stderr, "Error - can't open file '%s': %s\n", full_path, strerror(errno)); fprintf(stderr, "The option you called seems not to be compiled into your batman-adv kernel module.\n"); fprintf(stderr, "Consult the README if you wish to learn more about compiling options into batman-adv.\n");