aboutsummaryrefslogtreecommitdiffstats
path: root/packet-icp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-08-06 07:22:38 +0000
committerGuy Harris <guy@alum.mit.edu>2000-08-06 07:22:38 +0000
commit61aefd7470ac7ff134dfa3245033f6fabaae6285 (patch)
tree15fd7095c9d57da2f1ec8b38841613236c1a1740 /packet-icp.c
parent10fe2ebd843b25c2295ac19c8e48cf353d45f165 (diff)
downloadwireshark-61aefd7470ac7ff134dfa3245033f6fabaae6285.tar.gz
wireshark-61aefd7470ac7ff134dfa3245033f6fabaae6285.tar.bz2
wireshark-61aefd7470ac7ff134dfa3245033f6fabaae6285.zip
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. svn path=/trunk/; revision=2214
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,