aboutsummaryrefslogtreecommitdiffstats
path: root/packet-eth.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2000-05-16 04:44:14 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2000-05-16 04:44:14 +0000
commit0a2817cebacb5352ff348434db2571e218a21bdb (patch)
tree50401d28646b843ea7fdfac3e1487613b2bdc9af /packet-eth.c
parent9d92bf4eeb0ee6dfe7add0e88632eacac205feb3 (diff)
Have tvbuff's keep track of cap_len and pkt_len ('length' and 'reported_length'
in tvbuff terminology). This is implemented for TVBUFF_REAL and TVBUFF_SUBSET so far; support for TVBUFF_COMPOSITE is coming soon. Throw either ReportedBoundsError or BoundsError. A ReportedBoundsError is reported as "Malformed Frame" since the protocol stated that a certain number of bytes should be available but they weren't. A BoundsError is reported as a "Short Frame" since the snaplen was too short. Register proto_short (BoundsError) and proto_malformed (ReportedBounds) so searches can be made on "short" and "malformed". svn path=/trunk/; revision=1965
Diffstat (limited to 'packet-eth.c')
-rw-r--r--packet-eth.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/packet-eth.c b/packet-eth.c
index 54e91271b8..fbe02aa878 100644
--- a/packet-eth.c
+++ b/packet-eth.c
@@ -1,7 +1,7 @@
/* packet-eth.c
* Routines for ethernet packet disassembly
*
- * $Id: packet-eth.c,v 1.36 2000/05/15 06:22:05 gram Exp $
+ * $Id: packet-eth.c,v 1.37 2000/05/16 04:44:11 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -251,15 +251,15 @@ dissect_eth(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
/* Give the next dissector only 'length' number of bytes */
if (etype <= IEEE_802_3_MAX_LEN) {
TRY {
- next_tvb = tvb_new_subset(pi.compat_top_tvb, eth_offset, etype);
+ next_tvb = tvb_new_subset(pi.compat_top_tvb, eth_offset, etype, etype);
}
- CATCH(BoundsError) {
- next_tvb = tvb_new_subset(pi.compat_top_tvb, eth_offset, -1);
+ CATCH2(BoundsError, ReportedBoundsError) {
+ next_tvb = tvb_new_subset(pi.compat_top_tvb, eth_offset, -1, etype);
}
ENDTRY;
}
else {
- next_tvb = tvb_new_subset(pi.compat_top_tvb, eth_offset, -1);
+ next_tvb = tvb_new_subset(pi.compat_top_tvb, eth_offset, -1, -1);
}
switch (ethhdr_type) {