From a2414d8909088ddb40c907886e725993e6baecb5 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 22 Mar 2013 23:59:54 +0000 Subject: Don't wire into the reassembly code the notion that reassemblies should be done on flows from one address to another; reassembly for protocols running atop TCP should be done on flows from one TCP endpoint to another. We do this by: adding "reassembly table" as a data structure; associating hash tables for both in-progress reassemblies and completed reassemblies with that data structure (currently, not all reassemblies use the latter; they might keep completed reassemblies in the first table); having functions to create and destroy keys in that table; offering standard routines for doing address-based and address-and-port-based flow processing, so that dissectors not needing their own specialized flow processing can just use them. This fixes some mis-reassemblies of NIS YPSERV YPALL responses (where the second YPALL response is processed as if it were a continuation of a previous response between different endpoints, even though said response is already reassembled), and also allows the DCE RPC-specific stuff to be moved out of epan/reassembly.c into the DCE RPC dissector. svn path=/trunk/; revision=48491 --- epan/dissectors/packet-mux27010.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'epan/dissectors/packet-mux27010.c') diff --git a/epan/dissectors/packet-mux27010.c b/epan/dissectors/packet-mux27010.c index bb716ffdef..727bd38567 100644 --- a/epan/dissectors/packet-mux27010.c +++ b/epan/dissectors/packet-mux27010.c @@ -289,8 +289,7 @@ static gint ett_msg_fragments = -1; "Message fragments" }; -static GHashTable *msg_fragment_table = NULL; -static GHashTable *msg_reassembled_table = NULL; +static reassembly_table msg_reassembly_table; @@ -1059,10 +1058,11 @@ dissect_mux27010(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) memcpy(&pinfo_tmp, pinfo, sizeof(*pinfo)); - frag_msg = fragment_add_seq_check(tvb, tmpOffsetBegin, pinfo, + frag_msg = fragment_add_seq_check(&msg_reassembly_table, + tvb, tmpOffsetBegin, + pinfo, msg_seqid, /* ID for fragments belonging together */ - msg_fragment_table, /* list of message fragments */ - msg_reassembled_table, /* list of reassembled messages */ + NULL, msg_num, /* fragment sequence number */ (tmpOffsetEnd-tmpOffsetBegin)+1, /* fragment length */ msg_flag); /* More fragments? */ @@ -1134,8 +1134,8 @@ mux27010_init(void) /* * Initialize the fragment and reassembly tables. */ - fragment_table_init(&msg_fragment_table); - reassembled_table_init(&msg_reassembled_table); + reassembly_table_init(&msg_reassembly_table, + &addresses_reassembly_table_functions); } /*Register the protocol*/ -- cgit v1.2.1