From patchwork Tue Nov 1 12:12:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16794 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 C565582EFE; Tue, 1 Nov 2016 13:12:19 +0100 (CET) Authentication-Results: open-mesh.org; dmarc=none header.from=narfation.org Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=hUpRK06u; dkim-adsp=fail (unprotected policy); dkim-atps=neutral Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 57CB981BD1 for ; Tue, 1 Nov 2016 13:12:17 +0100 (CET) Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Received: from sven-desktop.home.narfation.org (p2003007C6F695BFECE9D1AA3674B0914.dip0.t-ipconnect.de [IPv6:2003:7c:6f69:5bfe:ce9d:1aa3:674b:914]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id E19DA1100A9; Tue, 1 Nov 2016 13:12:16 +0100 (CET) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1478002337; bh=0zf/AoUEPlbyhq1XMN+OZ2NtuRKBuKy2SPkq/eEuutQ=; h=From:To:Cc:Subject:Date:From; b=hUpRK06uccJ84soEmVSV5I//bDi+KAyEZRoT8yOWgVTa+4Ws9/58Lu1kJ2Xgw7fii hCxJLLTq0bPhZURbykbhPB4d3yAEC7ER4F+GZCp7vm20dKxGv/5TPqMkZ5/70xlglH WKXVAAoicegpsFFXH56d1dCKtjMM6jbiwhWv48aE= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Tue, 1 Nov 2016 13:12:13 +0100 Message-Id: <20161101121213.15607-1-sven@narfation.org> X-Mailer: git-send-email 2.10.1 Subject: [B.A.T.M.A.N.] [PATCH] alfred: Don't check for debugfs on startup X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 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" debugfs is deprecated and netlink is used by the modern batman-adv module. Thus it can easily happen that debugfs was not enabled during the build of batman-adv. Also netns may not have access to debugfs. So drop the check for transtable_global and originators for the specified mesh interface. Signed-off-by: Sven Eckelmann --- batadv_query.c | 30 ------------------------------ batadv_query.h | 1 - server.c | 4 ---- 3 files changed, 35 deletions(-) diff --git a/batadv_query.c b/batadv_query.c index a671b79..8815745 100644 --- a/batadv_query.c +++ b/batadv_query.c @@ -136,36 +136,6 @@ int ipv6_to_mac(const struct in6_addr *addr, struct ether_addr *mac) return 0; } -int batadv_interface_check(const char *mesh_iface) -{ - char full_path[MAX_PATH + 1]; - FILE *f; - - debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" DEBUG_TRANSTABLE_GLOBAL, - mesh_iface, full_path, sizeof(full_path)); - f = fopen(full_path, "r"); - if (!f) { - fprintf(stderr, - "Could not find %s for interface %s. Make sure it is a valid batman-adv soft-interface\n", - DEBUG_TRANSTABLE_GLOBAL, mesh_iface); - return -1; - } - fclose(f); - - debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" DEBUG_ORIGINATORS, - mesh_iface, full_path, sizeof(full_path)); - f = fopen(full_path, "r"); - if (!f) { - fprintf(stderr, - "Could not find %s for interface %s. Make sure it is a valid batman-adv soft-interface\n", - DEBUG_ORIGINATORS, mesh_iface); - return -1; - } - fclose(f); - - return 0; -} - static int translate_mac_debugfs(const char *mesh_iface, const struct ether_addr *mac, struct ether_addr *mac_out) diff --git a/batadv_query.h b/batadv_query.h index 320203b..907ed07 100644 --- a/batadv_query.h +++ b/batadv_query.h @@ -27,7 +27,6 @@ struct ether_addr *translate_mac(const char *mesh_iface, const struct ether_addr *mac); uint8_t get_tq(const char *mesh_iface, struct ether_addr *mac); -int batadv_interface_check(const char *mesh_iface); int mac_to_ipv6(const struct ether_addr *mac, struct in6_addr *addr); int ipv6_to_mac(const struct in6_addr *addr, struct ether_addr *mac); int is_ipv6_eui64(const struct in6_addr *addr); diff --git a/server.c b/server.c index 3a0ad8d..445e076 100644 --- a/server.c +++ b/server.c @@ -352,10 +352,6 @@ int alfred_server(struct globals *globals) return -1; } - if (strcmp(globals->mesh_iface, "none") != 0 && - batadv_interface_check(globals->mesh_iface) < 0) - return -1; - num_socks = netsock_open_all(globals); if (num_socks <= 0) { fprintf(stderr, "Failed to open interfaces\n");