From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH] alfred: Don't check for debugfs on startup
Date: Tue, 1 Nov 2016 13:12:13 +0100 [thread overview]
Message-ID: <20161101121213.15607-1-sven@narfation.org> (raw)
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 <sven@narfation.org>
---
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");
--
2.10.1
reply other threads:[~2016-11-01 12:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161101121213.15607-1-sven@narfation.org \
--to=sven@narfation.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).