From 815dcd255ea9da8b23e8e7c839545d5d41eee336 Mon Sep 17 00:00:00 2001 From: Jon Schipp Date: Mon, 4 Aug 2014 20:39:13 +0000 Subject: mausezahn: provide listen-addr option to configuration file Specify the listen-addr for the CLI in /etc/netsniff-ng/mausezahn.conf and remove the message, "mz: device not given, will use eth0" since we're listening by IP, rather than interface now, and this shows continues to show. $ grep listen-addr /etc/netsniff-ng/mausezahn.conf listen-addr = 127.0.0.1 $ mausezahn -V -x mz: device eth0 got assigned 10.0.2.15 and is a possible candidate. mz: device lo got assigned 127.0.0.1 (loopback) Opening config file /etc/netsniff-ng/mausezahn.conf... ... Mausezahn accepts incoming Telnet connections on 127.0.0.1:25542. Signed-off-by: Jon Schipp Signed-off-by: Tobias Klauser --- staging/cli.c | 10 +++++++--- staging/mausezahn.c | 2 -- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'staging') diff --git a/staging/cli.c b/staging/cli.c index a5ce174..3d39bd3 100644 --- a/staging/cli.c +++ b/staging/cli.c @@ -56,7 +56,7 @@ int cli_read_cfg(char *str) char dev[256]; FILE *fd; int i, j=0, len, found=0, nonspc=0; - int user=0, pass=0, ena=0, amp=0, mgmt_only=0, cli=0, port=0; + int user=0, pass=0, ena=0, amp=0, mgmt_only=0, cli=0, port=0, addr=0; strncpy(filename, str, 255); @@ -78,9 +78,10 @@ int cli_read_cfg(char *str) if (nonspc==0) continue; else nonspc=0; if (!user) user = sscanf(line, " user = %s ", mz_username); if (!pass) pass = sscanf(line, " password = %s ", mz_password); - if (!ena) ena = sscanf(line, " enable = %s ", mz_enable); + if (!ena) ena = sscanf(line, " enable = %s ", mz_enable); if (!port) port = sscanf(line, " port = %i ", &mz_port); - if (!cli) cli = sscanf(line, " cli-device = %s ", dev); + if (!addr) addr = sscanf(line, " listen-addr = %s ", mz_listen_addr); + if (!cli) cli = sscanf(line, " cli-device = %s ", dev); if (cli==1) { for (i=0; i find out! if ( (strncmp(argv[optind],"eth",3)==0) -- cgit v1.2.3-54-g00ecf