From 2814e3c9cd4d9393231a746b4ef1bb1e6b7d95c9 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 3 Jun 2017 10:14:39 -0700 Subject: If has_snaplen isn't set, don't set the snapshot length with pcap_create()/pcap_activate(). Just let libpcap pick the snapshot length; that way, for link-layer types that need a really large snapshot length, such as D-Bus (which requires 128MB for the largest messages), it can pick that, but can otherwise pick something that doesn't require as much memory, e.g. 256KB. For pcap_open_live() and pcap_open(), which don't have a way of saying "give me what's appropriate", pick 256KB. Change-Id: Idef5694f7dfa85eaf3a61d6ca7a17d263c417431 Reviewed-on: https://code.wireshark.org/review/21917 Reviewed-by: Guy Harris --- capchild/capture_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'capchild') diff --git a/capchild/capture_sync.c b/capchild/capture_sync.c index 57c2c86b8e..6dc0fcb84a 100644 --- a/capchild/capture_sync.c +++ b/capchild/capture_sync.c @@ -343,7 +343,7 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, inf argv = sync_pipe_add_arg(argv, &argc, "-f"); argv = sync_pipe_add_arg(argv, &argc, interface_opts.cfilter); } - if (interface_opts.snaplen != WTAP_MAX_PACKET_SIZE) { + if (interface_opts.has_snaplen) { argv = sync_pipe_add_arg(argv, &argc, "-s"); g_snprintf(ssnap, ARGV_NUMBER_LEN, "%d", interface_opts.snaplen); argv = sync_pipe_add_arg(argv, &argc, ssnap); -- cgit v1.2.1