3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-10-06 03:18:46 +02:00

monitor: Skip packet from PCAP file if it is truncated

This commit is contained in:
Marcel Holtmann 2014-08-12 00:40:07 -07:00
parent b00bea15ab
commit 581f00171d

View File

@ -170,8 +170,10 @@ static int process_pcap(struct pcap *pcap)
continue; continue;
} }
if (len < real_len) if (len < real_len) {
printf("Packet truncated from %u\n", real_len); printf("Packet truncated from %u\n", real_len);
continue;
}
pkt_type = L_GET_UNALIGNED((const uint16_t *) buf); pkt_type = L_GET_UNALIGNED((const uint16_t *) buf);
pkt_type = L_BE16_TO_CPU(pkt_type); pkt_type = L_BE16_TO_CPU(pkt_type);