diff options
author | Michael Tüxen <tuexen@fh-muenster.de> | 2011-06-28 08:00:14 +0000 |
---|---|---|
committer | Michael Tüxen <tuexen@fh-muenster.de> | 2011-06-28 08:00:14 +0000 |
commit | 6c094f6775a72ab2cf362cc5b172393a97dd68f5 (patch) | |
tree | 6f77b42632770f6ecd448ec4a2a6c097b87805de | |
parent | add36f416d9ec497a8ad95541482ca7037d5da4a (diff) | |
download | wireshark-6c094f6775a72ab2cf362cc5b172393a97dd68f5.tar.gz |
Use the filter argument as the capture filter for all interfaces.
Signal an error if another capture filter is provided using the
-f option.
svn path=/trunk/; revision=37811
-rw-r--r-- | tshark.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1388,7 +1388,7 @@ main(int argc, char *argv[]) if (cf_name != NULL) { if (rfilter != NULL) { cmdarg_err("Read filters were specified both with \"-R\" " - "and with additional command-line arguments"); + "and with additional command-line arguments."); return 1; } rfilter = get_args_as_string(argc, argv, optind); @@ -1396,7 +1396,7 @@ main(int argc, char *argv[]) #ifdef HAVE_LIBPCAP if (global_capture_opts.default_options.cfilter) { cmdarg_err("A default capture filter was specified both with \"-f\"" - " and with additional command-line arguments"); + " and with additional command-line arguments."); return 1; } for (i = 0; i < global_capture_opts.ifaces->len; i++) { @@ -1405,6 +1405,10 @@ main(int argc, char *argv[]) interface_opts.cfilter = get_args_as_string(argc, argv, optind); global_capture_opts.ifaces = g_array_remove_index(global_capture_opts.ifaces, i); g_array_insert_val(global_capture_opts.ifaces, i, interface_opts); + } else { + cmdarg_err("A capture filter was specified both with \"-f\"" + " and with additional command-line arguments."); + return 1; } } global_capture_opts.default_options.cfilter = get_args_as_string(argc, argv, optind); |