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-sndcp.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'epan/dissectors/packet-sndcp.c') diff --git a/epan/dissectors/packet-sndcp.c b/epan/dissectors/packet-sndcp.c index eaa85aff6c..1f2d34de30 100644 --- a/epan/dissectors/packet-sndcp.c +++ b/epan/dissectors/packet-sndcp.c @@ -101,14 +101,12 @@ static dissector_handle_t ip_handle; /* reassembly of N-PDU */ -static GHashTable *npdu_fragment_table = NULL; -static GHashTable *sndcp_reassembled_table = NULL; +static reassembly_table npdu_reassembly_table; static void sndcp_defragment_init(void) { - fragment_table_init(&npdu_fragment_table); - reassembled_table_init(&sndcp_reassembled_table); + reassembly_table_init(&npdu_reassembly_table, &addresses_reassembly_table_functions); } /* value strings @@ -332,11 +330,11 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) pinfo->fragmented = TRUE; if (unack) - fd_npdu = fragment_add_seq_check(tvb, offset, pinfo, npdu, - npdu_fragment_table, sndcp_reassembled_table, segment, len, more_frags); + fd_npdu = fragment_add_seq_check(&npdu_reassembly_table, tvb, offset, + pinfo, npdu, NULL, segment, len, more_frags); else - fd_npdu = fragment_add(tvb, offset, pinfo, npdu, - npdu_fragment_table, offset, len, more_frags); + fd_npdu = fragment_add(&npdu_reassembly_table, tvb, offset, pinfo, npdu, NULL, + offset, len, more_frags); npdu_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled N-PDU", fd_npdu, &npdu_frag_items, -- cgit v1.2.3