diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-10-08 17:42:18 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-10-08 17:42:18 +0000 |
commit | 7ea5330b241a0a4f6034a1261a322418b2f09fe6 (patch) | |
tree | 72af4a6485ba8507e620cb0f68505a6f9cfb7d75 /packet-ucp.c | |
parent | 971ceec9d233e9e59f9cf0c84c81e7794b7770a3 (diff) |
As UCP is atop TCP, its dissector isn't called unless there's at least
one byte in the tvbuff being handed to it, so the check I added for the
existence of that byte is unnecessary.
svn path=/trunk/; revision=4011
Diffstat (limited to 'packet-ucp.c')
-rw-r--r-- | packet-ucp.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/packet-ucp.c b/packet-ucp.c index d99f6a161c..6a841fbd29 100644 --- a/packet-ucp.c +++ b/packet-ucp.c @@ -2,7 +2,7 @@ * Routines for Universal Computer Protocol dissection * Copyright 2001, Tom Uijldert <tom.uijldert@cmg.nl> * - * $Id: packet-ucp.c,v 1.2 2001/10/08 17:37:52 guy Exp $ + * $Id: packet-ucp.c,v 1.3 2001/10/08 17:42:18 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -625,10 +625,6 @@ static const value_string vals_xser_service[] = { * \retval UCP_SHORTENED Packet may be there, but not complete * \retval UCP_MALFORMED Hmmmm, not UCP after all... * \retval UCP_INV_CHK Nice packet, but checksum doesn't add up... - * - * Note that this will not recognize any frames as UCP frames if the - * capture was made with a snapshot length shorter than the maximum - * frame length, as it checksums the entire packet. */ static int check_ucp(tvbuff_t *tvb, int *endpkt) @@ -638,9 +634,6 @@ check_ucp(tvbuff_t *tvb, int *endpkt) int pkt_check, tmp; int length; - if (!tvb_offset_exists(tvb, 0) || tvb_get_guint8(tvb, 0) != UCP_STX) - return UCP_MALFORMED; - length = tvb_find_guint8(tvb, offset, -1, UCP_ETX); if (length == -1) { *endpkt = tvb_reported_length_remaining(tvb, offset); @@ -1542,6 +1535,11 @@ dissect_ucp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *ucp_tree; tvbuff_t *tmp_tvb; + /* This runs atop TCP, so we are guaranteed that there is at least one + byte in the tvbuff. */ + if (tvb_get_guint8(tvb, 0) != UCP_STX) + return FALSE; + result = check_ucp(tvb, &endpkt); if (result == UCP_MALFORMED) |