aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ositp.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-ositp.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-ositp.c')
-rw-r--r--epan/dissectors/packet-ositp.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/epan/dissectors/packet-ositp.c b/epan/dissectors/packet-ositp.c
index 9011cd04e8..342f89d418 100644
--- a/epan/dissectors/packet-ositp.c
+++ b/epan/dissectors/packet-ositp.c
@@ -296,8 +296,7 @@ static heur_dissector_list_t cltp_heur_subdissector_list;
/*
* Reassembly of COTP.
*/
-static GHashTable *cotp_segment_table = NULL;
-static GHashTable *cotp_reassembled_table = NULL;
+static reassembly_table cotp_reassembly_table;
static guint16 cotp_dst_ref = 0;
static gboolean cotp_frame_reset = FALSE;
static gboolean cotp_last_fragment = FALSE;
@@ -1184,10 +1183,9 @@ static int ositp_decode_DT(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
* Note also that TP0 has no sequence number, and relies on
* the protocol atop which it runs to guarantee in-order delivery.
*/
- fd_head = fragment_add_seq_next(next_tvb, 0, pinfo, dst_ref,
- cotp_segment_table,
- cotp_reassembled_table,
- fragment_length, fragment);
+ fd_head = fragment_add_seq_next(&cotp_reassembly_table,
+ next_tvb, 0, pinfo, dst_ref, NULL,
+ fragment_length, fragment);
if (fd_head && fd_head->next) {
/* don't use -1 if fragment length is zero (throws Exception) */
proto_tree_add_text(cotp_tree, tvb, offset, (fragment_length) ? -1 : 0,
@@ -2259,8 +2257,16 @@ static gint dissect_ositp_inactive(tvbuff_t *tvb, packet_info *pinfo, proto_tree
static void
cotp_reassemble_init(void)
{
- fragment_table_init(&cotp_segment_table);
- reassembled_table_init(&cotp_reassembled_table);
+ /*
+ * XXX - this is a connection-oriented transport-layer protocol,
+ * so we should probably use more than just network-layer
+ * endpoint addresses to match segments together, but the functions
+ * in addresses_ports_reassembly_table_functions do matching based
+ * on port numbers, so they won't let us ensure that segments from
+ * different connections don't get assembled together.
+ */
+ reassembly_table_init(&cotp_reassembly_table,
+ &addresses_reassembly_table_functions);
cotp_dst_ref = 0;
}