From 581f00171dc7e5fc481cbf7b4586037ba86646f2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 12 Aug 2014 00:40:07 -0700 Subject: [PATCH] monitor: Skip packet from PCAP file if it is truncated --- monitor/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/monitor/main.c b/monitor/main.c index f9a9778f..ef9fd6a5 100644 --- a/monitor/main.c +++ b/monitor/main.c @@ -170,8 +170,10 @@ static int process_pcap(struct pcap *pcap) continue; } - if (len < real_len) + if (len < real_len) { printf("Packet truncated from %u\n", real_len); + continue; + } pkt_type = L_GET_UNALIGNED((const uint16_t *) buf); pkt_type = L_BE16_TO_CPU(pkt_type);