pcap-file
pcap-file copied to clipboard
Stuck on pcap
On the attached pcap this library ends up in a forever loop with:
pcap_reader: &mut PcapReader<File>
pcap_reader.next_packet()
pcap version 2.0.0
external_smtp.pcap: pcap capture file, microsecond ts (little-endian) - version 2.4 (Ethernet, capture length 1500)
It works for other pcaps
Thanks for reporting this bug. I found out the root cause. When a packet is malformed an error is returned but the parser doesn't advance. In your case that's caused by an invalid global pcap header snaplen value of 1500 when you have packets with a size > 1500.
I'll add the fix in the upcoming 3.0 version.
Hi! Just wanted to check if this issue is supposed to be resolved in version 3.0.0-rc1. I'm still experiencing the same problem, and after testing with that release candidate, the infinite loop persists.
In my case, the .pcap file is malformed due to the last packet. However, I’ve confirmed that the issue is not related to the packet’s position — even if I move that malformed packet to the middle of the file, the infinite loop still occurs. So it seems the problem is triggered by the packet itself, regardless of where it appears.
Thanks in advance, and let me know if I can help further with debugging or testing.
Hi, you're right it's not resolved in the 6.0.0-rc1. I found out the root cause but to fix it "well" I need to make a big change in the API and unfortunately I don't have the time to work on it right now. I'll keep you updated when I have the time to work on it.
Oh, I see. Thank you very much.