diff options
author | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-05-12 05:06:33 +0000 |
---|---|---|
committer | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-05-12 05:06:33 +0000 |
commit | 50db96efdf3b4833c578d19bd439f63ce5442de3 (patch) | |
tree | 1ff8a6397fe5c4ee5692435e343aa142a645a1e0 /packet-llc.c | |
parent | b34b13cc9fc94bd2648deeaefcedecd5c8e96304 (diff) |
In wiretap, set err to 0 before doing anything inside wtap_loop().
Tethereal was dying on me because err was initialized to some random value.
It was this section of code that would exit even if wtap_loop was successful
(returned TRUE) because err was never initialized or set to anything.
err = load_cap_file(&cf, out_file_type);
if (err != 0) {
dissect_cleanup();
exit(2);
}
<BIGGER sheepish grin>
Fixed even more errors in LLC dissector. I had inadvertantly used the
wrong tvbuff_t* when calling dissect_data_tvb(). There is no way we are going
to be successful in this tvbuff conversion w/o regression testing. I'm
working on setting up a simple Makefile for regression testing tonight.
That's why I'm finding so many bugs in my LLC conversion.
</BIGGER sheepish grin>
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1946 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-llc.c')
-rw-r--r-- | packet-llc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packet-llc.c b/packet-llc.c index 9b35a00914..a9bac08fd0 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.58 2000/05/12 04:21:21 gram Exp $ + * $Id: packet-llc.c,v 1.59 2000/05/12 05:06:26 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -395,11 +395,11 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; default: - dissect_data_tvb(tvb, pinfo, tree); + dissect_data_tvb(next_tvb, pinfo, tree); break; } } else - dissect_data_tvb(tvb, pinfo, tree); + dissect_data_tvb(next_tvb, pinfo, tree); break; case OUI_CABLE_BPDU: /* DOCSIS cable modem spanning tree BPDU */ @@ -415,7 +415,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(llc_tree, hf_llc_pid, tvb, 6, 2, etype); } - dissect_data_tvb(tvb, pinfo, tree); + dissect_data_tvb(next_tvb, pinfo, tree); break; } } @@ -432,6 +432,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ); } + next_tvb = tvb_new_subset(tvb, llc_header_len, -1); if (XDLC_IS_INFORMATION(control)) { tvb_compat(tvb, &pd, &offset); /* non-SNAP */ @@ -440,11 +441,10 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* do lookup with the subdissector table */ if (!dissector_try_port(subdissector_table, dsap, pd, offset, pinfo->fd, tree)) { - dissect_data_tvb(tvb, pinfo, tree); + dissect_data_tvb(next_tvb, pinfo, tree); } } else { - next_tvb = tvb_new_subset(tvb, llc_header_len, -1); - dissect_data_tvb(tvb, pinfo, tree); + dissect_data_tvb(next_tvb, pinfo, tree); } } } |