Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-bugs: [Wireshark-bugs] [Bug 2831] Add support the KDP (Kontiki Delivery Protocol)

Date: Wed, 27 Aug 2008 19:03:19 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2831





--- Comment #5 from Guy Harris <guy@xxxxxxxxxxxx>  2008-08-27 19:03:18 PDT ---
Also, actually, body_len should be based on tvb_reported_length(), rather than
tvb_length() - if the captured packets were cut off at a snapshot length, the
dissector should still try dissecting as if that data were there, so that an
exception will be thrown and the packet will be marked as having been cut short
(so the user knows that there's data that was in the packet but that's not in
the capture).

Note also that body_len should be a guint (not a guint8 - there's no guarantee
that a packet handed to your dissector will be 255 or fewer bytes long) -
*and*, before subtracting header_len from it (there's no need to subtract
UDP_HEADER_LEN, as UDP would already have removed the header from the tvbuff
handed to you, so the length doesn't include the UDP header or any headers
before the UDP header), you should check whether body_len is greater than or
equal to header_len; if it's not, you have a malformed packet, and should just
set body_len to 0.


-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.