diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-05-15 06:22:07 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-05-15 06:22:07 +0000 |
commit | ec3337ed07279039c217a70826947efc2bbdc2e3 (patch) | |
tree | 648cc6836e71384dde1353c1d103ce19894cbc90 /packet-isl.c | |
parent | 6c2a7af1f68d5b919f2d52e69e889ef5a1858392 (diff) | |
download | wireshark-ec3337ed07279039c217a70826947efc2bbdc2e3.tar.gz wireshark-ec3337ed07279039c217a70826947efc2bbdc2e3.tar.bz2 wireshark-ec3337ed07279039c217a70826947efc2bbdc2e3.zip |
Convert token-ring dissector to use tvbuffs.
Modify ethernet dissector to catch BoundsError if the attempt to
create next_tvb with the length specified in the ethernet header throws
an exception. In that case, next_tv is created with as many bytes as
are available in the frame.
Both dissect_tr() and dissect_eth() now have TRY blocks, which means
I had to fiddle with 'volatile' and 'static' storage options to get
things right (at least according to gcc).
svn path=/trunk/; revision=1962
Diffstat (limited to 'packet-isl.c')
-rw-r--r-- | packet-isl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packet-isl.c b/packet-isl.c index 4d1a94773d..9bd1fa5dd1 100644 --- a/packet-isl.c +++ b/packet-isl.c @@ -1,7 +1,7 @@ /* packet-isl.c * Routines for Cisco ISL Ethernet header disassembly * - * $Id: packet-isl.c,v 1.8 2000/05/11 08:15:17 gram Exp $ + * $Id: packet-isl.c,v 1.9 2000/05/15 06:22:06 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -144,6 +144,7 @@ dissect_isl(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_item *ti; guint8 type; guint16 length; + tvbuff_t *next_tvb; if (!BYTES_ARE_IN_FRAME(offset, ISL_HEADER_SIZE)) { dissect_data(pd, offset, fd, tree); @@ -224,7 +225,8 @@ dissect_isl(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) pd[offset+30]); proto_tree_add_item(fh_tree, hf_isl_esize, NullTVB, offset+16, 1, pd[offset+30]); - dissect_tr(pd, offset+31, fd, tree); + next_tvb = tvb_new_subset(pi.compat_top_tvb, offset+31, -1); + dissect_tr(next_tvb, &pi, tree); break; default: |