Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcpdump: pcap_loop: invalid packet capture length 305933, bigger than maximum of 262144 #856

Closed
zynzynack opened this issue May 29, 2020 · 2 comments

Comments

@zynzynack
Copy link

Unsure if this is a tcpprep usage-of-tcpdump issue, or an issue with tcpdump. Also see appneta/tcpreplay#571

tcpdump version 4.9.3
libpcap version 1.8.1
tcpprep version: 4.2.6
Ubuntu 18.04.4 LTS

$ tcpdump -i eth0 -w my.pcap
wait....CTRL-C

$ tcpprep -v -a server -o my.cache -i my.pcap
reading from file -, link-type EN10MB (Ethernet)
tcpdump: pcap_loop: invalid packet capture length 305933, bigger than maximum of 262144

Enlarging

#define MAXIMUM_SNAPLEN 262144
to satisfy

tcpdump/tcpdump.c

Line 1747 in 8d3c2ed

|| ndo->ndo_snaplen < 0 || ndo->ndo_snaplen > MAXIMUM_SNAPLEN)
solves this.

@guyharris
Copy link
Member

Unsure if this is a tcpprep usage-of-tcpdump issue, or an issue with tcpdump.

I vote "tcpprep usage-of-tcpdump issue", as there appears to be another such issue, at least on macOS:

$ tcpdump -i en0 -w my.pcap
tcpdump: listening on en0, link-type EN10MB (Ethernet), capture size 262144 bytes
^C2195 packets captured
2195 packets received by filter
0 packets dropped by kernel
$ tcpprep -v -a server -o my.cache -i my.pcap
tcpdump: unknown file format
$ file my.pcap
my.pcap: tcpdump capture file (little-endian) - version 2.4 (Ethernet, capture length 262144)

If you do tcpdump -r my.pcap it will probably work; if it does, this is definitely a tcpprep usage-of-tcpdump issue.

@zynzynack
Copy link
Author

Agreed, upgrading from the Ubuntu repo supplied tcpreplay package containing "tcpprep version: 4.2.6 (build git:v4.2.6) (debug)" to latest release of tcpreplay "tcpprep version: 4.3.1 (build git:v4.3.1)" resolves this issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants