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-smb.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-smb.c')
-rw-r--r-- | epan/dissectors/packet-smb.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c index 041ed824fd..18b49f897c 100644 --- a/epan/dissectors/packet-smb.c +++ b/epan/dissectors/packet-smb.c @@ -1039,12 +1039,20 @@ fid_cmp(smb_fid_info_t *fida, smb_fid_info_t *fidb) static gboolean smb_trans_reassembly = TRUE; gboolean smb_dcerpc_reassembly = TRUE; -static GHashTable *smb_trans_fragment_table = NULL; +static reassembly_table smb_trans_reassembly_table; static void smb_trans_reassembly_init(void) { - fragment_table_init(&smb_trans_fragment_table); + /* + * XXX - addresses_ports_reassembly_table_functions? + * Probably correct for SMB-over-NBT and SMB-over-TCP, + * as stuff from two different connections should + * probably not be combined, but what about other + * transports for SMB, e.g. NBF or Netware? + */ + reassembly_table_init(&smb_trans_reassembly_table, + &addresses_reassembly_table_functions); } static fragment_data * @@ -1074,11 +1082,12 @@ smb_trans_defragment(proto_tree *tree _U_, packet_info *pinfo, tvbuff_t *tvb, } if (!pinfo->fd->flags.visited) { - fd_head = fragment_add(tvb, offset, pinfo, - si->sip->frame_req, smb_trans_fragment_table, + fd_head = fragment_add(&smb_trans_reassembly_table, tvb, offset, + pinfo, si->sip->frame_req, NULL, pos, count, more_frags); } else { - fd_head = fragment_get(pinfo, si->sip->frame_req, smb_trans_fragment_table); + fd_head = fragment_get(&smb_trans_reassembly_table, + pinfo, si->sip->frame_req, NULL); } if (!fd_head || !(fd_head->flags & FD_DEFRAGMENTED)) { |