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>
/*
* 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;
/*