Mark un-reassembled TCP segments as (possibly) being un-reassembled, by

setting the "pinfo->fragmented" flag.

If a ReportedBoundsError occurs, flag the frame as being an
unreassembled packet, not an unreassembled fragmented packet, as it may
have been segmented across TCP segment boundaries rather than being part
of an IPv4/IPv6/CLNP/etc. fragmented/segmented packet.

svn path=/trunk/; revision=4558
This commit is contained in:
Guy Harris 2002-01-17 09:28:22 +00:00
parent cd172815f6
commit 816e7978c4
2 changed files with 13 additions and 5 deletions

View File

@ -2,7 +2,7 @@
*
* Top-most dissector. Decides dissector based on Wiretap Encapsulation Type.
*
* $Id: packet-frame.c,v 1.18 2002/01/17 06:29:16 guy Exp $
* $Id: packet-frame.c,v 1.19 2002/01/17 09:28:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -169,9 +169,9 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
if (check_col(pinfo->cinfo, COL_INFO))
col_append_str(pinfo->cinfo, COL_INFO,
"[Unreassembled Fragmented Packet]");
"[Unreassembled Packet]");
proto_tree_add_protocol_format(tree, proto_unreassembled,
tvb, 0, 0, "[Unreassembled Fragmented Packet: %s]",
tvb, 0, 0, "[Unreassembled Packet: %s]",
pinfo->current_proto );
} else {
if (check_col(pinfo->cinfo, COL_INFO))

View File

@ -1,7 +1,7 @@
/* packet-tcp.c
* Routines for TCP packet disassembly
*
* $Id: packet-tcp.c,v 1.124 2002/01/10 11:27:57 guy Exp $
* $Id: packet-tcp.c,v 1.125 2002/01/17 09:28:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -536,6 +536,8 @@ desegment_tcp(tvbuff_t *tvb, packet_info *pinfo, int offset,
/*
* Show what's left in the packet as data.
* XXX - remember what protocol the last subdissector
* was, and report it as a continuation of that, instead.
*/
call_dissector(data_handle,tvb_new_subset(tvb, deseg_offset,-1,tvb_reported_length_remaining(tvb,deseg_offset)), pinfo, tree);
}
@ -834,6 +836,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint16 computed_cksum;
guint length_remaining;
struct tcpinfo tcpinfo;
gboolean save_fragmented;
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, "TCP");
@ -1091,8 +1094,13 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Yes. */
desegment_tcp(tvb, pinfo, offset, th_seq, nxtseq, th_sport, th_dport, tree, tcp_tree);
} else {
/* No - just call the subdissector. */
/* No - just call the subdissector.
Mark this as fragmented, so if somebody throws an exception,
we don't report it as a malformed frame. */
save_fragmented = pinfo->fragmented;
pinfo->fragmented = TRUE;
decode_tcp_ports(tvb, offset, pinfo, tree, th_sport, th_dport);
pinfo->fragmented = save_fragmented;
}
}
}