diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-05-28 22:02:17 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-05-28 22:02:17 +0000 |
commit | 713245f76cfcd264419e2331b5ec25c34b71d673 (patch) | |
tree | d3d72f748b6a9ea7da75550f823811d347f10827 /packet-llc.c | |
parent | a2b30d028c225a301eaddaeeee9ee55a24415725 (diff) | |
download | wireshark-713245f76cfcd264419e2331b5ec25c34b71d673.tar.gz wireshark-713245f76cfcd264419e2331b5ec25c34b71d673.tar.bz2 wireshark-713245f76cfcd264419e2331b5ec25c34b71d673.zip |
In the FDDI and LLC dissectors, extract fields as we use them, so that
we don't get an exception (and thus a "Short Frame" or "Malformed
Frame" entry) until we get to a field that isn't in the frame.
svn path=/trunk/; revision=2021
Diffstat (limited to 'packet-llc.c')
-rw-r--r-- | packet-llc.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/packet-llc.c b/packet-llc.c index df9a7a6394..8ea2942d69 100644 --- a/packet-llc.c +++ b/packet-llc.c @@ -2,7 +2,7 @@ * Routines for IEEE 802.2 LLC layer * Gilbert Ramirez <gram@xiexie.org> * - * $Id: packet-llc.c,v 1.62 2000/05/28 21:21:23 guy Exp $ + * $Id: packet-llc.c,v 1.63 2000/05/28 22:02:17 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -285,11 +285,6 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } dsap = tvb_get_guint8(tvb, 0); - ssap = tvb_get_guint8(tvb, 1); - - is_snap = (dsap == SAP_SNAP) && (ssap == SAP_SNAP); - llc_header_len = 2; /* DSAP + SSAP */ - if (tree) { ti = proto_tree_add_item(tree, proto_llc, tvb, 0, 0, NULL); llc_tree = proto_item_add_subtree(ti, ett_llc); @@ -297,6 +292,11 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) 1, dsap & SAP_MASK); proto_tree_add_item(llc_tree, hf_llc_dsap_ig, tvb, 0, 1, dsap & DSAP_GI_BIT); + } else + llc_tree = NULL; + + ssap = tvb_get_guint8(tvb, 1); + if (tree) { proto_tree_add_item(llc_tree, hf_llc_ssap, tvb, 1, 1, ssap & SAP_MASK); proto_tree_add_item(llc_tree, hf_llc_ssap_cr, tvb, 1, @@ -304,6 +304,9 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } else llc_tree = NULL; + is_snap = (dsap == SAP_SNAP) && (ssap == SAP_SNAP); + llc_header_len = 2; /* DSAP + SSAP */ + /* * XXX - the page referred to in the comment above about the * Command/Response bit also implies that LLC Type 2 always |