aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gssapi.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-gssapi.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-gssapi.c')
-rw-r--r--epan/dissectors/packet-gssapi.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/epan/dissectors/packet-gssapi.c b/epan/dissectors/packet-gssapi.c
index e6b7c832c9..248908762d 100644
--- a/epan/dissectors/packet-gssapi.c
+++ b/epan/dissectors/packet-gssapi.c
@@ -98,12 +98,13 @@ static const fragment_items gssapi_frag_items = {
};
-static GHashTable *gssapi_fragment_table = NULL;
+static reassembly_table gssapi_reassembly_table;
static void
gssapi_reassembly_init(void)
{
- fragment_table_init(&gssapi_fragment_table);
+ reassembly_table_init(&gssapi_reassembly_table,
+ &addresses_reassembly_table_functions);
}
/*
@@ -255,8 +256,9 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
goto done;
}
se_tree_insert32(gss_info->frags, pinfo->fd->num, fi);
- fd_head=fragment_add(tvb, 0, pinfo, fi->first_frame,
- gssapi_fragment_table, gss_info->frag_offset,
+ fd_head=fragment_add(&gssapi_reassembly_table,
+ tvb, 0, pinfo, fi->first_frame, NULL,
+ gss_info->frag_offset,
tvb_length(tvb), TRUE);
gss_info->frag_offset+=tvb_length(tvb);
@@ -279,7 +281,8 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
&& (gssapi_reassembly) ){
fi=(gssapi_frag_info_t *)se_tree_lookup32(gss_info->frags, pinfo->fd->num);
if(fi){
- fd_head=fragment_get(pinfo, fi->first_frame, gssapi_fragment_table);
+ fd_head=fragment_get(&gssapi_reassembly_table,
+ pinfo, fi->first_frame, NULL);
if(fd_head && (fd_head->flags&FD_DEFRAGMENTED)){
if(pinfo->fd->num==fi->reassembled_in){
proto_item *frag_tree_item;
@@ -424,10 +427,11 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
fi->reassembled_in=0;
se_tree_insert32(gss_info->frags, pinfo->fd->num, fi);
- fragment_add(gss_tvb, 0, pinfo, pinfo->fd->num,
- gssapi_fragment_table, 0,
- tvb_length(gss_tvb), TRUE);
- fragment_set_tot_len(pinfo, pinfo->fd->num, gssapi_fragment_table, len1+oid_start_offset);
+ fragment_add(&gssapi_reassembly_table,
+ gss_tvb, 0, pinfo, pinfo->fd->num, NULL,
+ 0, tvb_length(gss_tvb), TRUE);
+ fragment_set_tot_len(&gssapi_reassembly_table,
+ pinfo, pinfo->fd->num, NULL, len1+oid_start_offset);
gss_info->do_reassembly=TRUE;
gss_info->first_frame=pinfo->fd->num;