}
successful = libpcap_write_interface_description_block(ld->pdh,
interface_opts.name,
- interface_opts.cfilter,
+ interface_opts.cfilter?interface_opts.cfilter:"",
pcap_opts->linktype,
pcap_opts->snaplen,
&ld->bytes_written,
pcap_opts = g_array_index(global_ld.pcaps, pcap_options *, i);
successful = libpcap_write_interface_description_block(global_ld.pdh,
interface_opts.name,
- interface_opts.cfilter,
+ interface_opts.cfilter?interface_opts.cfilter:"",
pcap_opts->linktype,
pcap_opts->snaplen,
&(global_ld.bytes_written),
pcap_opts = g_array_index(global_ld.pcaps, pcap_options *, i);
interface_opts = g_array_index(capture_opts->ifaces, interface_options, i);
/* init the input filter from the network interface (capture pipe will do nothing) */
+ /*
+ * When remote capturing WinPCap crashes when the capture filter
+ * is NULL. This might be a bug in WPCap. Therefore we provide an emtpy
+ * string.
+ */
switch (capture_loop_init_filter(pcap_opts->pcap_h, pcap_opts->from_cap_pipe,
interface_opts.name,
- interface_opts.cfilter)) {
+ interface_opts.cfilter?interface_opts.cfilter:"")) {
case INITFILTER_NO_ERROR:
break;
machine_readable = TRUE;
break;
default:
- case '?': /* Bad flag - print usage message */
cmdarg_err("Invalid Option: %s", argv[optind-1]);
+ case '?': /* Bad flag - print usage message */
arg_error = TRUE;
break;
}
}
- argc -= optind;
- argv += optind;
- if (argc >= 1) {
- /* user specified file name as regular command-line argument */
- /* XXX - use it as the capture file name (or something else)? */
- argc--;
- argv++;
- }
-
- if (argc != 0) {
- /*
- * Extra command line arguments were specified; complain.
- * XXX - interpret as capture filter, as tcpdump and tshark do?
- */
- cmdarg_err("Invalid argument: %s", argv[0]);
- arg_error = TRUE;
+ if (!arg_error) {
+ argc -= optind;
+ argv += optind;
+ if (argc >= 1) {
+ /* user specified file name as regular command-line argument */
+ /* XXX - use it as the capture file name (or something else)? */
+ argc--;
+ argv++;
+ }
+ if (argc != 0) {
+ /*
+ * Extra command line arguments were specified; complain.
+ * XXX - interpret as capture filter, as tcpdump and tshark do?
+ */
+ cmdarg_err("Invalid argument: %s", argv[0]);
+ arg_error = TRUE;
+ }
}
if (arg_error) {