aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iax2.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-03-22 23:59:54 +0000
committerGuy Harris <guy@alum.mit.edu>2013-03-22 23:59:54 +0000
commita2414d8909088ddb40c907886e725993e6baecb5 (patch)
tree53f0ebac8baa171f4317c7eb502a354da8596c72 /epan/dissectors/packet-iax2.c
parent3295912210fa1a8d7d0b1a18aa7c100f27905ed1 (diff)
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
Diffstat (limited to 'epan/dissectors/packet-iax2.c')
-rw-r--r--epan/dissectors/packet-iax2.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c
index 67b4a85d05..070da5a47c 100644
--- a/epan/dissectors/packet-iax2.c
+++ b/epan/dissectors/packet-iax2.c
@@ -508,7 +508,7 @@ typedef struct {
/* tables */
static GHashTable *iax_fid_table = NULL;
-static GHashTable *iax_fragment_table = NULL;
+static reassembly_table iax_reassembly_table;
static GHashTable *iax_circuit_hashtab = NULL;
static guint circuitcount = 0;
@@ -674,7 +674,8 @@ static void iax_init_hash( void )
g_hash_table_destroy(iax_fid_table);
iax_fid_table = g_hash_table_new(g_direct_hash, g_direct_equal);
- fragment_table_init(&iax_fragment_table);
+ reassembly_table_init(&iax_reassembly_table,
+ &addresses_reassembly_table_functions);
}
@@ -2156,8 +2157,7 @@ static void desegment_iax(tvbuff_t *tvb, packet_info *pinfo, proto_tree *iax2_tr
}
/* fragment_add checks for already-added */
- fd_head = fragment_add(tvb, 0, pinfo, fid,
- iax_fragment_table,
+ fd_head = fragment_add(&iax_reassembly_table, tvb, 0, pinfo, fid, NULL,
frag_offset,
frag_len, !complete);
@@ -2177,7 +2177,7 @@ static void desegment_iax(tvbuff_t *tvb, packet_info *pinfo, proto_tree *iax2_tr
if (pinfo->desegment_len &&
(pinfo->desegment_offset < old_len)) {
/* oops, it wasn't actually complete */
- fragment_set_partial_reassembly(pinfo, fid, iax_fragment_table);
+ fragment_set_partial_reassembly(&iax_reassembly_table, pinfo, fid, NULL);
if (pinfo->desegment_len == DESEGMENT_ONE_MORE_SEGMENT) {
/* only one more byte should be enough for a retry */
dirdata->current_frag_minlen = fd_head->datalen + 1;
@@ -2244,8 +2244,8 @@ static void desegment_iax(tvbuff_t *tvb, packet_info *pinfo, proto_tree *iax2_tr
dirdata->current_frag_minlen = frag_len + pinfo->desegment_len;
}
- fd_head = fragment_add(tvb, deseg_offset, pinfo, fid,
- iax_fragment_table,
+ fd_head = fragment_add(&iax_reassembly_table,
+ tvb, deseg_offset, pinfo, fid, NULL,
0, frag_len, TRUE);
#ifdef DEBUG_DESEGMENT
g_debug("Start offset of undissected bytes: %u; "