aboutsummaryrefslogtreecommitdiffstats
path: root/packet-icp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-08-06 07:22:38 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-08-06 07:22:38 +0000
commita3dd49742a0ca5198d2c0650dedd37626b252d6c (patch)
tree15fd7095c9d57da2f1ec8b38841613236c1a1740 /packet-icp.c
parentb90978d08519624e351848eaae4dc750968deb93 (diff)
Don't use "fd->pkt_len" when checking to see if you've run off the end
of the packet, use "pi.captured_len" - "fd->pkt_len" may include data that isn't in the capture, due to a short snapshot length. Don't use "fd->cap_len" when checking to see if you've run off the end of the packe, use "pi.captured_len" - "fd->cap_len" isn't adjusted to reflect any length fields, but "pi.captured_len" is (removing, for example, Ethernet padding from the packet). Use "END_OF_FRAME" rather than "pi.captured_len - offset", to make it a bit clearer what's being done. In the V.120 dissector, use "tvb_length()" when adding the top-level protocol tree entry for V.120, as it's a tvbuffified dissector. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2214 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-icp.c')
-rw-r--r--packet-icp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/packet-icp.c b/packet-icp.c
index f273a29e22..ae60c254f1 100644
--- a/packet-icp.c
+++ b/packet-icp.c
@@ -2,7 +2,7 @@
* Routines for ICP (internet cache protocol) packet disassembly
* RFC 2186 && RFC 2187
*
- * $Id: packet-icp.c,v 1.8 2000/05/31 05:07:06 guy Exp $
+ * $Id: packet-icp.c,v 1.9 2000/08/06 07:22:33 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Peter Torvals
@@ -107,7 +107,7 @@ static void dissect_icp_payload( const u_char *pd, int offset,
frame_data *fd,proto_tree *pload_tree, e_icphdr *icph)
{
/* To Be Done take care of fragmentation*/
-guint32 maxlength=fd->pkt_len-offset;
+guint32 maxlength=END_OF_FRAME;
guint32 i;
guint16 objectlength;
switch(icph->opcode)
@@ -209,7 +209,7 @@ static void dissect_icp(const u_char *pd, int offset, frame_data *fd,
if (tree)
{
- ti = proto_tree_add_item(tree,proto_icp, NullTVB,offset,fd->pkt_len-offset, FALSE);
+ ti = proto_tree_add_item(tree,proto_icp, NullTVB,offset,END_OF_FRAME, FALSE);
icp_tree = proto_item_add_subtree(ti, ett_icp);
proto_tree_add_uint_format(icp_tree,hf_icp_opcode, NullTVB, offset, 1,