}
fd_head->flags |= FD_DEFRAGMENTED;
fd_head->reassembled_in = pinfo->fd->num;
+ fd_head->reas_in_layer_num = pinfo->curr_layer_num;
}
static void
fd_head->flags &= (~FD_TOOLONGFRAGMENT) & (~FD_MULTIPLETAILS);
fd_head->datalen=0;
fd_head->reassembled_in=0;
+ fd_head->reas_in_layer_num = 0;
} else {
/*
* No. Bail out since we have no idea what to
allows us to skip any trailing fragments */
fd_head->flags |= FD_DEFRAGMENTED;
fd_head->reassembled_in=pinfo->fd->num;
+ fd_head->reas_in_layer_num = pinfo->curr_layer_num;
/* we don't throw until here to avoid leaking old_data and others */
if (fd_head->error) {
*/
fd_head->flags |= FD_DEFRAGMENTED;
fd_head->reassembled_in=pinfo->fd->num;
+ fd_head->reas_in_layer_num = pinfo->curr_layer_num;
}
/*
fd_head->flags &= (~FD_TOOLONGFRAGMENT) & (~FD_MULTIPLETAILS);
fd_head->datalen=0;
fd_head->reassembled_in=0;
+ fd_head->reas_in_layer_num = 0;
}
if (orig_keyp != NULL)
*orig_keyp = NULL;
fd_head->reassembled_in=pinfo->fd->num;
+ fd_head->reas_in_layer_num = pinfo->curr_layer_num;
return fd_head;
}
fd_head->flags = FD_BLOCKSEQUENCE|FD_DATALEN_SET;
fd_head->tvb_data = NULL;
fd_head->reassembled_in = 0;
+ fd_head->reas_in_layer_num = 0;
fd_head->error = NULL;
insert_fd_head(table, fd_head, pinfo, id, data);
gboolean update_col_info;
proto_item *frag_tree_item;
- if (fd_head != NULL && pinfo->fd->num == fd_head->reassembled_in) {
+ if (fd_head != NULL && pinfo->fd->num == fd_head->reassembled_in && pinfo->curr_layer_num == fd_head->reas_in_layer_num) {
/*
* OK, we've reassembled this.
* Is this something that's been reassembled from more
typedef struct _fragment_item {
struct _fragment_item *next;
- guint32 frame; /* XXX - does this apply to reassembly heads? */
- guint32 offset; /* XXX - does this apply to reassembly heads? */
- guint32 len; /* XXX - does this apply to reassembly heads? */
- guint32 fragment_nr_offset; /* offset for frame numbering, for sequences, where the
- * provided fragment number of the first fragment does
- * not start with 0
- * XXX - does this apply only to reassembly heads? */
- guint32 datalen; /* Only valid in first item of list and when
- * flags&FD_DATALEN_SET is set;
- * number of bytes or (if flags&FD_BLOCKSEQUENCE set)
- * segments in the datagram */
- guint32 reassembled_in; /* frame where this PDU was reassembled,
- only valid in the first item of the list
- and when FD_DEFRAGMENTED is set*/
- guint32 flags; /* XXX - do some of these apply only to reassembly
- heads and others only to fragments within
- a reassembly? */
+ guint32 frame; /* XXX - does this apply to reassembly heads? */
+ guint32 offset; /* XXX - does this apply to reassembly heads? */
+ guint32 len; /* XXX - does this apply to reassembly heads? */
+ guint32 fragment_nr_offset; /**< offset for frame numbering, for sequences, where the
+ * provided fragment number of the first fragment does
+ * not start with 0
+ * XXX - does this apply only to reassembly heads? */
+ guint32 datalen; /**< Only valid in first item of list and when
+ * flags&FD_DATALEN_SET is set;
+ * number of bytes or (if flags&FD_BLOCKSEQUENCE set)
+ * segments in the datagram */
+ guint32 reassembled_in; /**< frame where this PDU was reassembled,
+ only valid in the first item of the list
+ and when FD_DEFRAGMENTED is set*/
+ guint8 reas_in_layer_num; /**< The current "depth" or layer number in the current frame where reassembly was completed.
+ * Example: in SCTP there can be several data chunks and we want the reassemblied tvb for the final
+ * segment only.
+ */
+ guint32 flags; /**< XXX - do some of these apply only to reassembly
+ heads and others only to fragments within
+ a reassembly? */
tvbuff_t *tvb_data;
-
- /*
+ /**
* Null if the reassembly had no error; non-null if it had
* an error, in which case it's the string for the error.
*