From 22990159d2a1c4c8cd93d64af959864468b1edc7 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 19 Aug 2019 19:54:36 -0700 Subject: [PATCH] Boost the maximum snaplen for LINKTYPE_USBPCAP/DLT_USBPCAP. See the referenced Wireshark bug for a discussion. Express all the maximum values in terms of MiB while we're at it. --- pcap-common.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pcap-common.c b/pcap-common.c index 21cfdba6b8..3fb4086e0f 100644 --- a/pcap-common.c +++ b/pcap-common.c @@ -1347,13 +1347,17 @@ linktype_to_dlt(int linktype) * * For most link-layer types, we use MAXIMUM_SNAPLEN. * - * For DLT_DBUS, the maximum is 134217728, as per + * For DLT_DBUS, the maximum is 128MiB, as per * * https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-messages * - * For DLT_EBHSCR, the maximum is 8MB, as per + * For DLT_EBHSCR, the maximum is 8MiB, as per * * https://www.elektrobit.com/ebhscr + * + * For DLT_USBPCAP, the maximum is 1MiB, as per + * + * https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15985 */ u_int max_snaplen_for_dlt(int dlt) @@ -1361,11 +1365,14 @@ max_snaplen_for_dlt(int dlt) switch (dlt) { case DLT_DBUS: - return 134217728; + return 128*1024*1024; case DLT_EBHSCR: return 8*1024*1024; + case DLT_USBPCAP: + return 1024*1024; + default: return MAXIMUM_SNAPLEN; }