summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHåkon Nessjøen <haakon.nessjoen@gmail.com>2013-01-11 13:44:56 +0100
committerHåkon Nessjøen <haakon.nessjoen@gmail.com>2013-01-11 13:44:56 +0100
commit9c6a8fd84ff7dddf01d5e1b33a6a6d935816795b (patch)
treec8e82992d602cf55d2246fca869fc2628cfeea58
parentb31a2824a5a2abfd8b7dc68fec2d266dd5f943d7 (diff)
downloadMAC-Telnet-9c6a8fd84ff7dddf01d5e1b33a6a6d935816795b.tar.gz
MAC-Telnet-9c6a8fd84ff7dddf01d5e1b33a6a6d935816795b.zip
Fixed a bug requiring -t to be used before -l
-rw-r--r--mactelnet.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mactelnet.c b/mactelnet.c
index 0006f07..51d9df1 100644
--- a/mactelnet.c
+++ b/mactelnet.c
@@ -69,6 +69,7 @@ static struct in_addr destip;
static int sourceport;
static int connect_timeout = CONNECT_TIMEOUT;
+static char run_mndp = 0;
static int mndp_timeout = 0;
static int is_a_tty = 1;
@@ -485,7 +486,7 @@ int main (int argc, char **argv) {
break;
case 'l':
- return mndp(mndp_timeout);
+ run_mndp = 1;
break;
case 'h':
@@ -495,6 +496,9 @@ int main (int argc, char **argv) {
}
}
+ if (run_mndp) {
+ return mndp(mndp_timeout);
+ }
if (argc - optind < 1 || print_help) {
print_version();
fprintf(stderr, _("Usage: %s <MAC|identity> [-h] [-n] [-t <timeout>] [-u <user>] [-p <password>] [-U <user>] | -l\n"), argv[0]);