From 60e339bba4926cd3d299b142896a1d475d81e00d Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 13 Apr 2021 12:35:02 -0700 Subject: Don't handle -k in capture_opts_add_opt(). It's not a generic capture option also supported by TShark and dumpcap, it's Wireshark-specific (dumpcap *always* starts a capture, and TShark starts one iff it's passed one or more interfaces on which to capture; only Wireshark needs it to start the capture immediately - that's a relic of the days when Wireshark *itself* did what dumpcap now does for Wireshark). Handle it in commandline_other_options(), rather than in capture_opts_add_opt(). That lets us get rid of an argument to capture_opts_add_opt(), and dummy variables in TShark and dumpcap used to work with that extra argument. --- dumpcap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'dumpcap.c') diff --git a/dumpcap.c b/dumpcap.c index 84c2889788..91b2b9dc6f 100644 --- a/dumpcap.c +++ b/dumpcap.c @@ -4850,7 +4850,6 @@ main(int argc, char *argv[]) struct sigaction action, oldaction; #endif - gboolean start_capture = TRUE; gboolean stats_known; struct pcap_stat stats = {0}; GLogLevelFlags log_flags; @@ -5195,7 +5194,7 @@ main(int argc, char *argv[]) case 'I': /* Monitor mode */ #endif case LONGOPT_COMPRESS_TYPE: /* compress type */ - status = capture_opts_add_opt(&global_capture_opts, opt, optarg, &start_capture); + status = capture_opts_add_opt(&global_capture_opts, opt, optarg); if (status != 0) { exit_main(status); } -- cgit v1.2.3