/* reassemble.c
* Routines for {fragment,segment} reassembly
*
- * $Id: reassemble.c,v 1.30 2003/04/09 09:04:08 sahlberg Exp $
+ * $Id: reassemble.c,v 1.31 2003/04/17 10:31:35 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
{
fragment_key key, *new_key;
fragment_data *fd_head;
+ fragment_data *fd_item;
fragment_data *fd;
fragment_data *fd_i;
guint32 max, dfpos;
unsigned char *old_data;
+ gboolean already_added=FALSE;
/* create key to search hash with */
key.src = pinfo->src;
fd_head = g_hash_table_lookup(fragment_table, &key);
+ /* Just check if we have seen this fragment before, i.e.
+ if we have already added it to reassembly.
+ We can not trust the flags.visited field since we sometimes
+ might call a subdissector multiple times.
+ As an additional check just make sure we have not already added
+ this frame to the reassembly list
+ */
+ for(fd_item=fd_head;fd_item;fd_item=fd_item->next){
+ if(pinfo->fd->num==fd_item->frame){
+ already_added=TRUE;
+ }
+ }
/* have we already seen this frame ?*/
- if (pinfo->fd->flags.visited) {
+ if (pinfo->fd->flags.visited || already_added) {
if (fd_head != NULL && fd_head->flags & FD_DEFRAGMENTED) {
return fd_head;
} else {