diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2013-08-01 20:44:50 +0000 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2013-08-01 20:44:50 +0000 |
commit | 0cbe856098e5f20cf873c0974ae6a0b314c267f6 (patch) | |
tree | eb912257c69bf463f651e439553c789e58ee4b67 /tshark.c | |
parent | 73444a24e0200c46fa20bbe1a3aa737a9aee2981 (diff) |
simplify argument checking for tshark
if a capture file is read, do all corresponding checks in one place
svn path=/trunk/; revision=51086
Diffstat (limited to 'tshark.c')
-rw-r--r-- | tshark.c | 22 |
1 files changed, 9 insertions, 13 deletions
@@ -1596,19 +1596,6 @@ main(int argc, char *argv[]) return 1; } - /* We don't support capture filters when reading from a capture file - (the BPF compiler doesn't support all link-layer types that we - support in capture files we read). */ -#ifdef HAVE_LIBPCAP - if (cf_name != NULL) { - if (global_capture_opts.default_options.cfilter) { - cmdarg_err("Only read filters, not capture filters, " - "can be specified when reading a capture file."); - return 1; - } - } -#endif - if (print_hex) { if (output_action != WRITE_TEXT) { cmdarg_err("Raw packet hex data can only be printed as text or PostScript"); @@ -1655,6 +1642,15 @@ main(int argc, char *argv[]) * "-r" was specified, so we're reading a capture file. * Capture options don't apply here. */ + + /* We don't support capture filters when reading from a capture file + (the BPF compiler doesn't support all link-layer types that we + support in capture files we read). */ + if (global_capture_opts.default_options.cfilter) { + cmdarg_err("Only read filters, not capture filters, " + "can be specified when reading a capture file."); + return 1; + } if (global_capture_opts.multi_files_on) { cmdarg_err("Multiple capture files requested, but " "a capture isn't being done."); |