3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-24 15:22:34 +01:00

monitor: Fix issue with large packets in PCAP files

This commit is contained in:
Marcel Holtmann 2014-08-10 12:19:58 -07:00
parent 91c305d9af
commit 9cdb52a167

View File

@ -155,6 +155,9 @@ bool pcap_read(struct pcap *pcap, struct timeval *tv,
if (bytes_read < 0) if (bytes_read < 0)
return false; return false;
if (bytes_read < pkt.incl_len)
lseek(pcap->fd, pkt.incl_len - bytes_read, SEEK_CUR);
if (tv) { if (tv) {
tv->tv_sec = pkt.ts_sec; tv->tv_sec = pkt.ts_sec;
tv->tv_usec = pkt.ts_usec; tv->tv_usec = pkt.ts_usec;