aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorPantar Ana <ana.pantar@gmail.com>2019-01-15 14:38:09 +0100
committerAnders Broman <a.broman58@gmail.com>2019-01-18 07:50:54 +0000
commit0e151f3987c80f2ec17e1c1143f36bb47ec4b7cd (patch)
tree35c11788d4e5545b036b4133bef8e61f17f8b719 /wiretap
parent10bcb40c5e9e7248d8b63835425e2f3a88bbea96 (diff)
ebhscr: increasing ebhscr snaplen
Change-Id: Ie033196c099927912b1e7849299e786dc8416923 Reviewed-on: https://code.wireshark.org/review/31554 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/file_access.c3
-rw-r--r--wiretap/pcap-common.c5
-rw-r--r--wiretap/wtap.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c
index 698d02b9b5..894da7b085 100644
--- a/wiretap/file_access.c
+++ b/wiretap/file_access.c
@@ -2343,6 +2343,7 @@ wtap_dump_init_dumper(int file_type_subtype, wtap_compression_type compression_t
*
* We use WTAP_MAX_PACKET_SIZE_STANDARD for everything except
* D-Bus, which has a maximum packet size of 128MB,
+ * and EBHSCR, which has a maximum packet size of 8MB,
* which is more than we want to put into files
* with other link-layer header types, as that
* might cause some software reading those files
@@ -2351,6 +2352,8 @@ wtap_dump_init_dumper(int file_type_subtype, wtap_compression_type compression_t
*/
if (params->encap == WTAP_ENCAP_DBUS)
snaplen = 128*1024*1024;
+ else if (params->encap == WTAP_ENCAP_EBHSCR)
+ snaplen = 8*1024*1024;
else
snaplen = WTAP_MAX_PACKET_SIZE_STANDARD;
}
diff --git a/wiretap/pcap-common.c b/wiretap/pcap-common.c
index 9f1d10da7a..812d2ef289 100644
--- a/wiretap/pcap-common.c
+++ b/wiretap/pcap-common.c
@@ -738,14 +738,19 @@ wtap_wtap_encap_to_pcap_encap(int encap)
* some programs reading them to allocate a huge and wasteful buffer
* and, at least on 32-bit platforms, run the risk of running out of
* memory.
+ * For EBHSCR, we use WTAP_MAX_PACKET_SIZE_EBHSCR, because the maximum
+ * EBHSCR message size is 8MB
*/
guint
wtap_max_snaplen_for_encap(int wtap_encap)
{
if (wtap_encap == WTAP_ENCAP_DBUS)
return WTAP_MAX_PACKET_SIZE_DBUS;
+ else if (wtap_encap == WTAP_ENCAP_EBHSCR)
+ return WTAP_MAX_PACKET_SIZE_EBHSCR;
else
return WTAP_MAX_PACKET_SIZE_STANDARD;
+
}
/*
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index 2f907feae3..96631b8e99 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -409,6 +409,7 @@ extern "C" {
* allocate a buffer much larger than necessary, wasting memory.
*/
#define WTAP_MAX_PACKET_SIZE_STANDARD 262144
+#define WTAP_MAX_PACKET_SIZE_EBHSCR (8*1024*1024)
#define WTAP_MAX_PACKET_SIZE_DBUS (128*1024*1024)
/*