aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-10-08 11:41:33 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-10-08 20:20:43 +0200
commit168949e119104ca1c916b3e3593ef11235380e1f (patch)
tree376a7e05fec90435cd1fe3a7022d7a06eb28b0fa /include
parentdb7be4463239a9945ed307d4af55e467a78db984 (diff)
client: Set snaplen to MAXIMUM_SNAPLEN
Despite this value not being exported publicly, the truth is that tcpdump and wireshark nowadays avoid processing any file with snaplen bigger than this value: "tcpdump: pcap_loop: invalid packet capture length 861244, bigger than snaplen of 262144" It also fails to set snaplen to values bigger than that: "tcpdump -s 262145" --> "tcpdump: invalid snaplen 262145" pcapfix also warns about wrong packet length if bigger than same value (defined as PCAP_MAX_SNAPLEN there). MAXIMUM_SPANPLEN is defined in tcpdump's netdissect.h and libpcap's pcap-int.h. It is also defined as WTAP_MAX_PACKET_SIZE in wireshark/wiretap/wtap.h (this one being the only publicly available). Change-Id: Ib7449d5aba9da342c150704ebd0e1f09e7f7276c
Diffstat (limited to 'include')
-rw-r--r--include/osmo-pcap/common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/osmo-pcap/common.h b/include/osmo-pcap/common.h
index 27fd514..5d977f1 100644
--- a/include/osmo-pcap/common.h
+++ b/include/osmo-pcap/common.h
@@ -58,4 +58,9 @@ extern const char *osmopcap_copyright;
extern int osmopcap_go_parent(struct vty *vty);
extern int osmopcap_is_config_node(struct vty *vty, int node);
+/* defined in libpcap's pcap-int.h, which is not public */
+#ifndef MAXIMUM_SNAPLEN
+#define MAXIMUM_SNAPLEN 262144
+#endif
+
#endif