From 2de653340c789c2ef4b442b146c3f3e53e306c31 Mon Sep 17 00:00:00 2001 From: Jon Schipp Date: Thu, 24 Jul 2014 18:01:43 +0000 Subject: mausezahn: bind to IP address in interactive mode Adds new option ``-l'' that can be used to set mausezahn's listen address to bind to an IP of choice. e.g. mausezahn -l 127.0.0.1 -x Signed-off-by: Jon Schipp Signed-off-by: Tobias Klauser --- staging/mausezahn.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'staging/mausezahn.c') diff --git a/staging/mausezahn.c b/staging/mausezahn.c index 759ac28..8b2c499 100644 --- a/staging/mausezahn.c +++ b/staging/mausezahn.c @@ -33,7 +33,7 @@ int verbose_level = 0; -static const char *short_options = "46hqvVSxra:A:b:B:c:d:E:f:F:p:P:t:T:M:Q:X:"; +static const char *short_options = "46hqvVSxra:A:b:B:c:d:E:f:F:l:p:P:t:T:M:Q:X:"; static void signal_handler(int number) { @@ -109,6 +109,7 @@ static void help(void) "Usage: mausezahn [options] [interface] ||\n" "Options:\n" " -x Interactive mode with telnet CLI, default port: 25542\n" + " -l Listen address to bind to when in interactive mode, default: 0.0.0.0\n" " -4 IPv4 mode (default)\n" " -6 IPv6 mode\n" " -c Send packet count times, default:1, infinite:0\n" @@ -208,8 +209,9 @@ int reset() fp2 = NULL; mz_port = 0; mz_rand = 0; + char mz_listen_addr[15] = "0.0.0.0"; mp_head = NULL; - + for (i=0;i