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
1 changed files with 3 additions and 0 deletions

View File

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