If we do reassembly and hand the packet to the dissector, and the
dissector says "sorry, I need even more data in this packet", don't flag that packet as being reassembled in that frame. Indicate that we should perhaps do all the "partial reassembly" stuff in "fragment_set_partial_assembly()", which would obviate the need for the hack in the TCP dissector. Clean up indentation. svn path=/trunk/; revision=15139
This commit is contained in:
parent
70fb017866
commit
0c5af0dde6
|
@ -1941,12 +1941,15 @@ desegment_tcp(tvbuff_t *tvb, packet_info *pinfo, int offset,
|
|||
*/
|
||||
show_fragment_tree(ipfd_head, &tcp_segment_items,
|
||||
tree, pinfo, next_tvb, &frag_tree_item);
|
||||
/* the toplevel fragment subtree is now behind all desegmented data,
|
||||
* move it right behind the TCP tree */
|
||||
tcp_tree_item = proto_tree_get_parent(tcp_tree);
|
||||
if(frag_tree_item && tcp_tree_item) {
|
||||
proto_tree_move_item(tree, tcp_tree_item, frag_tree_item);
|
||||
}
|
||||
/*
|
||||
* The toplevel fragment subtree is now
|
||||
* behind all desegmented data; move it
|
||||
* right behind the TCP tree.
|
||||
*/
|
||||
tcp_tree_item = proto_tree_get_parent(tcp_tree);
|
||||
if(frag_tree_item && tcp_tree_item) {
|
||||
proto_tree_move_item(tree, tcp_tree_item, frag_tree_item);
|
||||
}
|
||||
|
||||
/* Did the subdissector ask us to desegment
|
||||
some more data? This means that the data
|
||||
|
@ -2066,14 +2069,15 @@ desegment_tcp(tvbuff_t *tvb, packet_info *pinfo, int offset,
|
|||
}
|
||||
|
||||
if (!called_dissector || pinfo->desegment_len != 0) {
|
||||
if (ipfd_head != NULL && ipfd_head->reassembled_in != 0) {
|
||||
if (ipfd_head != NULL && ipfd_head->reassembled_in != 0 &&
|
||||
!(ipfd_head->flags & FD_PARTIAL_REASSEMBLY)) {
|
||||
/*
|
||||
* We know what frame this PDU is reassembled in;
|
||||
* let the user know.
|
||||
*/
|
||||
item=proto_tree_add_uint(tcp_tree, hf_tcp_reassembled_in,
|
||||
tvb, 0, 0, ipfd_head->reassembled_in);
|
||||
PROTO_ITEM_SET_GENERATED(item);
|
||||
PROTO_ITEM_SET_GENERATED(item);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -476,6 +476,17 @@ fragment_set_partial_reassembly(packet_info *pinfo, guint32 id, GHashTable *frag
|
|||
|
||||
fd_head = g_hash_table_lookup(fragment_table, &key);
|
||||
|
||||
/*
|
||||
* XXX - why not do all the stuff done early in "fragment_add_work()",
|
||||
* turning off FD_DEFRAGMENTED and pointing the fragments' data
|
||||
* pointers to the appropriate part of the already-reassembled
|
||||
* data, and clearing the data length and "reassembled in" frame
|
||||
* number, here? We currently have a hack in the TCP dissector
|
||||
* not to set the "reassembled in" value if the "partial reassembly"
|
||||
* flag is set, so that in the first pass through the packets
|
||||
* we don't falsely set a packet as reassembled in that packet
|
||||
* if the dissector decided that even more reassembly was needed.
|
||||
*/
|
||||
if(fd_head){
|
||||
fd_head->flags |= FD_PARTIAL_REASSEMBLY;
|
||||
}
|
||||
|
@ -600,6 +611,7 @@ fragment_add_work(fragment_data *fd_head, tvbuff_t *tvb, int offset,
|
|||
fd_head->flags ^= FD_DEFRAGMENTED|FD_PARTIAL_REASSEMBLY;
|
||||
fd_head->flags &= (~FD_TOOLONGFRAGMENT) & (~FD_MULTIPLETAILS);
|
||||
fd_head->datalen=0;
|
||||
fd_head->reassembled_in=0;
|
||||
}
|
||||
|
||||
if (!more_frags) {
|
||||
|
|
Loading…
Reference in New Issue