From 850f894337bdd4079e1cbe66d4df325d232a5cd8 Mon Sep 17 00:00:00 2001 From: speed Date: Tue, 16 Jun 2015 21:18:00 +0200 Subject: [PATCH] more friendliness for non-eth0 ifaces --- cli/src/admin.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cli/src/admin.c b/cli/src/admin.c index 62e366f..d017aca 100644 --- a/cli/src/admin.c +++ b/cli/src/admin.c @@ -208,7 +208,7 @@ int main (int argc, char **argv) {0, 0, 0, 0} }; char *line, *com[MAXCOM]; - const char *iface = "eth0", *password = NULL; + const char *iface = NULL, *password = NULL; float timeout = 0.f; bool kb = false, force = false, global = true; struct timeval tv; @@ -287,13 +287,18 @@ int main (int argc, char **argv) printf("unknown trailing options\n"); goto end; } - + + if (iface == NULL) + { + fprintf(stderr, "no interface specified (-i), defaulting to eth0\n"); + iface = "eth0"; + } memset(com, 0, MAXCOM * sizeof(char*)); nga = ngadmin_init(iface); if (nga == NULL) { - fprintf(stderr, "initialization error\n"); + fprintf(stderr, "initialization error (bad interface ?)\n"); goto end; } -- 2.39.5