aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-08-19 21:16:46 -0700
committerGuy Harris <guy@alum.mit.edu>2019-08-20 04:57:17 +0000
commit303f6f1b392514794474b31e076d873796f341d7 (patch)
tree366c37f3a0f11af5c4471edb81f70ac9610f8ab6 /dumpcap.c
parent4278234a1db0d98247f2062a879f78cc9d741d6d (diff)
Boost the maximum packet size for LINKTYPE_USBPCAP in pcap/pcapng.
Bug: 15985 Change-Id: I8e043431bbf874d640d4407335d525a44815ee73 Reviewed-on: https://code.wireshark.org/review/34327 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 5daee8bf89..31a6ab8b05 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -1944,24 +1944,24 @@ pcap_pipe_open_live(int fd,
hdr->network = GUINT32_SWAP_LE_BE(hdr->network);
}
pcap_src->linktype = hdr->network;
-#ifdef DLT_DBUS
- if (pcap_src->linktype == DLT_DBUS) {
- /*
- * The maximum D-Bus message size is 128MB, so allow packets up
- * to that size.
- */
+ /* Pick the appropriate maximum packet size for the link type */
+ switch (pcap_src->linktype) {
+
+ case 231: /* DLT_DBUS */
pcap_src->cap_pipe_max_pkt_size = WTAP_MAX_PACKET_SIZE_DBUS;
- } else
-#endif
- if (pcap_src->linktype == 279) { /* DLT_EBHSCR */
- /*
- * The maximum EBHSCR message size is 8MB, so allow packets up
- * to that size.
- */
+ break;
+
+ case 279: /* DLT_EBHSCR */
pcap_src->cap_pipe_max_pkt_size = WTAP_MAX_PACKET_SIZE_EBHSCR;
- }
- else {
+ break;
+
+ case 249: /* DLT_USBPCAP */
+ pcap_src->cap_pipe_max_pkt_size = WTAP_MAX_PACKET_SIZE_USBPCAP;
+ break;
+
+ default:
pcap_src->cap_pipe_max_pkt_size = WTAP_MAX_PACKET_SIZE_STANDARD;
+ break;
}
if (hdr->version_major < 2) {