diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-05-30 05:26:05 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-05-30 05:26:05 +0000 |
commit | f4f6d359bea2cbfb4c308854a3ffe799bf1c73ee (patch) | |
tree | fdc3b8c438ea29a573800ff2527762d60df25231 | |
parent | 5f070c161d68380e6408e35a098787fa26a393a2 (diff) |
Don't pass "tvb_reported_length_remaining(tvb, offset)" as the fourth
argument to "tvb_new_subset()" - just use -1 if the subset tvbuff is to
run to the end of the parent tvbuff.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5599 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r-- | packet-afp.c | 8 | ||||
-rw-r--r-- | packet-gvrp.c | 26 | ||||
-rw-r--r-- | packet-ipsec.c | 10 | ||||
-rw-r--r-- | packet-ospf.c | 5 |
4 files changed, 33 insertions, 16 deletions
diff --git a/packet-afp.c b/packet-afp.c index 7df53232c6..44af1f8e93 100644 --- a/packet-afp.c +++ b/packet-afp.c @@ -2,7 +2,7 @@ * Routines for afp packet dissection * Copyright 2002, Didier Gautheron <dgautheron@magic.fr> * - * $Id: packet-afp.c,v 1.15 2002/05/11 22:40:40 guy Exp $ + * $Id: packet-afp.c,v 1.16 2002/05/30 05:26:05 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2640,8 +2640,10 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset = dissect_reply_afp_write(tvb, pinfo, afp_tree, offset);break; } } - if (tree && offset < len) - call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, afp_tree); + if (tree && offset < len) { + call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), + pinfo, afp_tree); + } } static void afp_reinit( void) diff --git a/packet-gvrp.c b/packet-gvrp.c index 2ea834eaae..793eb05f60 100644 --- a/packet-gvrp.c +++ b/packet-gvrp.c @@ -2,7 +2,7 @@ * Routines for GVRP (GARP VLAN Registration Protocol) dissection * Copyright 2000, Kevin Shi <techishi@ms22.hinet.net> * - * $Id: packet-gvrp.c,v 1.10 2002/01/21 07:36:34 guy Exp $ + * $Id: packet-gvrp.c,v 1.11 2002/05/30 05:26:05 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -145,7 +145,9 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree_add_text(gvrp_tree, tvb, GARP_PROTOCOL_ID, sizeof(guint16), " (Warning: this version of Ethereal only knows about protocol id = 1)"); - call_dissector(data_handle,tvb_new_subset(tvb, GARP_PROTOCOL_ID + sizeof(guint16), -1,tvb_reported_length_remaining(tvb,GARP_PROTOCOL_ID + sizeof(guint16))), pinfo, tree); + call_dissector(data_handle, + tvb_new_subset(tvb, GARP_PROTOCOL_ID + sizeof(guint16), -1, -1), + pinfo, tree); return; } @@ -175,7 +177,8 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } else { - call_dissector(data_handle,tvb_new_subset(tvb, offset, -1,tvb_reported_length_remaining(tvb,offset)),pinfo, tree); + call_dissector(data_handle, + tvb_new_subset(tvb, offset, -1, -1), pinfo, tree); return; } } @@ -192,7 +195,8 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* GVRP only supports one attribute type. */ if (octet != GVRP_ATTRIBUTE_TYPE) { - call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, tree); + call_dissector(data_handle, tvb_new_subset(tvb, offset,-1, -1), + pinfo, tree); return; } @@ -225,7 +229,8 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } else { - call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, tree); + call_dissector(data_handle, + tvb_new_subset(tvb, offset, -1, -1), pinfo, tree); return; } } @@ -256,7 +261,9 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case GVRP_EVENT_LEAVEALL: if (octet != GVRP_LENGTH_LEAVEALL) { - call_dissector(data_handle,tvb_new_subset(tvb, offset, -1,tvb_reported_length_remaining(tvb,offset)),pinfo, tree); + call_dissector(data_handle, + tvb_new_subset(tvb, offset, -1, -1), pinfo, + tree); return; } break; @@ -268,7 +275,9 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case GVRP_EVENT_EMPTY: if (octet != GVRP_LENGTH_NON_LEAVEALL) { - call_dissector(data_handle,tvb_new_subset(tvb, offset, -1,tvb_reported_length_remaining(tvb,offset)),pinfo, tree); + call_dissector(data_handle, + tvb_new_subset(tvb, offset, -1, -1),pinfo, + tree); return; } @@ -281,7 +290,8 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; default: - call_dissector(data_handle,tvb_new_subset(tvb, offset, -1,tvb_reported_length_remaining(tvb,offset)),pinfo, tree); + call_dissector(data_handle, + tvb_new_subset(tvb, offset, -1, -1), pinfo, tree); return; } } diff --git a/packet-ipsec.c b/packet-ipsec.c index 77ab02d973..1e1e6fcafb 100644 --- a/packet-ipsec.c +++ b/packet-ipsec.c @@ -1,7 +1,7 @@ /* packet-ipsec.c * Routines for IPsec/IPComp packet disassembly * - * $Id: packet-ipsec.c,v 1.39 2002/05/10 23:20:38 guy Exp $ + * $Id: packet-ipsec.c,v 1.40 2002/05/30 05:26:05 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -229,7 +229,9 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_uint(esp_tree, hf_esp_sequence, tvb, offsetof(struct newesp, esp_seq), 4, (guint32)ntohl(esp.esp_seq)); - call_dissector(data_handle,tvb_new_subset(tvb, sizeof(struct newesp),-1,tvb_reported_length_remaining(tvb,sizeof(struct newesp))), pinfo, esp_tree); + call_dissector(data_handle, + tvb_new_subset(tvb, sizeof(struct newesp), -1, -1), + pinfo, esp_tree); } } @@ -279,7 +281,9 @@ dissect_ipcomp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_uint(ipcomp_tree, hf_ipcomp_cpi, tvb, offsetof(struct ipcomp, comp_cpi), 2, ntohs(ipcomp.comp_cpi)); - call_dissector(data_handle,tvb_new_subset(tvb, sizeof(struct ipcomp), -1,tvb_reported_length_remaining(tvb,sizeof(struct ipcomp))),pinfo, ipcomp_tree); + call_dissector(data_handle, + tvb_new_subset(tvb, sizeof(struct ipcomp), -1, -1), pinfo, + ipcomp_tree); } } diff --git a/packet-ospf.c b/packet-ospf.c index a307bd7652..9844fffe62 100644 --- a/packet-ospf.c +++ b/packet-ospf.c @@ -2,7 +2,7 @@ * Routines for OSPF packet disassembly * (c) Copyright Hannes R. Boehm <hannes@boehm.org> * - * $Id: packet-ospf.c,v 1.67 2002/05/14 09:46:38 guy Exp $ + * $Id: packet-ospf.c,v 1.68 2002/05/30 05:26:05 guy Exp $ * * At this time, this module is able to analyze OSPF * packets as specified in RFC2328. MOSPF (RFC1584) and other @@ -634,7 +634,8 @@ dissect_ospf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; default: - call_dissector(data_handle,tvb_new_subset(tvb, ospf_header_length,-1,tvb_reported_length_remaining(tvb,ospf_header_length)), pinfo, tree); + call_dissector(data_handle, + tvb_new_subset(tvb, ospf_header_length, -1, -1), pinfo, tree); break; } } |