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-ndps.c | |
parent | 3295912210fa1a8d7d0b1a18aa7c100f27905ed1 (diff) | |
download | wireshark-a2414d8909088ddb40c907886e725993e6baecb5.tar.gz |
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-ndps.c')
-rw-r--r-- | epan/dissectors/packet-ndps.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ndps.c b/epan/dissectors/packet-ndps.c index a09a5d1b8f..5383d422e2 100644 --- a/epan/dissectors/packet-ndps.c +++ b/epan/dissectors/packet-ndps.c @@ -42,9 +42,8 @@ /* Limit the number of items we can add to the tree. */ #define NDPS_MAX_ITEMS 100 -/* Tables for reassembly of fragments. */ -static GHashTable *ndps_fragment_table = NULL; -static GHashTable *ndps_reassembled_table = NULL; +/* Table for reassembly of fragments. */ +static reassembly_table ndps_reassembly_table; /* desegmentation of ndps */ static gboolean ndps_defragment = TRUE; @@ -4103,8 +4102,8 @@ static void ndps_init_protocol(void) { /* fragment */ - fragment_table_init(&ndps_fragment_table); - reassembled_table_init(&ndps_reassembled_table); + reassembly_table_init(&ndps_reassembly_table, + &addresses_reassembly_table_functions); if (ndps_req_hash) g_hash_table_destroy(ndps_req_hash); @@ -4393,7 +4392,7 @@ ndps_defrag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) len = tvb_reported_length(tvb); if (tvb_length(tvb) >= len) { - fd_head = fragment_add_seq_next(tvb, 0, pinfo, tid, ndps_fragment_table, ndps_reassembled_table, len, !spx_info_p->eom); + fd_head = fragment_add_seq_next(&ndps_reassembly_table, tvb, 0, pinfo, tid, NULL, len, !spx_info_p->eom); if (fd_head != NULL) { /* Is this the last fragment? EOM will indicate */ |