diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-03-22 23:59:54 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-03-22 23:59:54 +0000 |
commit | a2414d8909088ddb40c907886e725993e6baecb5 (patch) | |
tree | 53f0ebac8baa171f4317c7eb502a354da8596c72 /epan/dissectors/packet-fc.c | |
parent | 3295912210fa1a8d7d0b1a18aa7c100f27905ed1 (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-fc.c')
-rw-r--r-- | epan/dissectors/packet-fc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c index 394b6ac774..e5482bb3d7 100644 --- a/epan/dissectors/packet-fc.c +++ b/epan/dissectors/packet-fc.c @@ -151,7 +151,7 @@ typedef struct _fc_conv_data_t { /* Reassembly stuff */ static gboolean fc_reassemble = TRUE; static guint32 fc_max_frame_size = 1024; -static GHashTable *fc_fragment_table = NULL; +static reassembly_table fc_reassembly_table; typedef struct _fcseq_conv_key { guint32 conv_idx; @@ -189,7 +189,8 @@ fcseq_hash (gconstpointer v) static void fc_exchange_init_protocol(void) { - fragment_table_init(&fc_fragment_table); + reassembly_table_init(&fc_reassembly_table, + &addresses_reassembly_table_functions); if (fcseq_req_hash) g_hash_table_destroy(fcseq_req_hash); @@ -1159,8 +1160,9 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean frag_id = ((pinfo->oxid << 16) ^ seq_id) | is_exchg_resp ; /* We assume that all frames are of the same max size */ - fcfrag_head = fragment_add (tvb, FC_HEADER_SIZE, pinfo, frag_id, - fc_fragment_table, + fcfrag_head = fragment_add (&fc_reassembly_table, + tvb, FC_HEADER_SIZE, + pinfo, frag_id, NULL, real_seqcnt * fc_max_frame_size, frag_size, !is_lastframe_inseq); |