From 9cdb52a167107dc5c10d75eaa916e457d522d075 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 10 Aug 2014 12:19:58 -0700 Subject: [PATCH] monitor: Fix issue with large packets in PCAP files --- monitor/pcap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/monitor/pcap.c b/monitor/pcap.c index 9cb249c0..377b0fa9 100644 --- a/monitor/pcap.c +++ b/monitor/pcap.c @@ -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;