From e53a1adf49c4b0f585b99f66c5a0ceb3653d840e Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 10 Jun 2016 00:40:18 -0700 Subject: Always count packets per encapsulation. Currently, for pcapng files, if all of the IDBs we've seen *so far* are the same, we report it as the file's encapsulation type; however, we may see IDBs of a different type in the future, so don't check for per-packet encapsulation before counting packets of the encapsulation type. Change-Id: I617ddcf2963aa16e7ba58855b3e5bf326ab7dc32 Reviewed-on: https://code.wireshark.org/review/15808 Reviewed-by: Guy Harris --- capinfos.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'capinfos.c') diff --git a/capinfos.c b/capinfos.c index f36e07a633..de38662c8b 100644 --- a/capinfos.c +++ b/capinfos.c @@ -1158,14 +1158,11 @@ process_cap_file(wtap *wth, const char *filename) snaplen_max_inferred = phdr->caplen; } - /* Per-packet encapsulation */ - if (wtap_file_encap(wth) == WTAP_ENCAP_PER_PACKET) { - if ((phdr->pkt_encap > 0) && (phdr->pkt_encap < WTAP_NUM_ENCAP_TYPES)) { - cf_info.encap_counts[phdr->pkt_encap] += 1; - } else { - fprintf(stderr, "capinfos: Unknown per-packet encapsulation %d in frame %u of file \"%s\"\n", - phdr->pkt_encap, packet, filename); - } + if ((phdr->pkt_encap > 0) && (phdr->pkt_encap < WTAP_NUM_ENCAP_TYPES)) { + cf_info.encap_counts[phdr->pkt_encap] += 1; + } else { + fprintf(stderr, "capinfos: Unknown packet encapsulation %d in frame %u of file \"%s\"\n", + phdr->pkt_encap, packet, filename); } /* Packet interface_id info */ -- cgit v1.2.1