pcap

pcap_pkthdr caplen is 0 in v1.10.3


I'm capturing using non-blocking pcap_dispatch and my packet handling function seems to be collecting packets properly and dumping them into the file because I can open the file in Wireshark and see that there are packets. But I cannot seem to track the size since caplen is 0 and the len field is sometimes the same large number (in this case 896715280) or 0. Is there a change that causes this to happen? I think I could calculate the size in version 1.10.0.


Solution

  • Is there a change that causes this to happen?

    Using a version of libpcap built with 32-bit time_t values in a program built with 64-bit time_t values, as per this comment on your libpcap issue.