aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2015-08-29 10:00:02 -0400
committerHadriel Kaplan <hadrielk@yahoo.com>2015-08-29 14:54:59 +0000
commit9158176b7f9a95f2ea701290a39ed53dc70bf834 (patch)
treef7d86110845f0d080172c15f1bca06282075e095 /wiretap
parent0badc8c38e56e60bdd5d4fd95f78486234067a16 (diff)
pcapng: make SPB cap_len the same as packet_len if IDB snaplen is 0
An IDB snaplen of 0 means no limit, so a Simple Packet Block's capture length should be the same as its encoded packet length in such a case. Bug: 11483 Change-Id: I8856d6c6a669a0048ea64b3adbd23c37a598431d Reviewed-on: https://code.wireshark.org/review/10303 Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/pcapng.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c
index 8bc118800f..27645e4929 100644
--- a/wiretap/pcapng.c
+++ b/wiretap/pcapng.c
@@ -1481,10 +1481,11 @@ pcapng_read_simple_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *
/*
* The captured length is not a field in the SPB; it can be
* calculated as the minimum of the snapshot length from the
- * IDB and the packet length, as per the pcap-ng spec.
+ * IDB and the packet length, as per the pcap-ng spec. An IDB
+ * snapshot length of 0 means no limit.
*/
simple_packet.cap_len = simple_packet.packet_len;
- if (simple_packet.cap_len > iface_info.snap_len)
+ if (simple_packet.cap_len > iface_info.snap_len && iface_info.snap_len != 0)
simple_packet.cap_len = iface_info.snap_len;
/*