aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-02-27 03:56:48 +0000
committerGuy Harris <guy@alum.mit.edu>2003-02-27 03:56:48 +0000
commit4156806b8b2eb003245290870d0980a9bd485ce6 (patch)
tree0203bdbc10be0aace55799c00593228993e9a594
parent1837c71d7d3f0de9e23b5019139e9a8d45bfb442 (diff)
From Didier Gautheron: provide a mechanism to indicate why reassembly
wasn't done, and, for TCP, use that mechanism if reassembly isn't done is an incorrect TCP checksum. svn path=/trunk/; revision=7212
-rw-r--r--epan/packet.c3
-rw-r--r--epan/packet_info.h3
-rw-r--r--packet-frame.c11
-rw-r--r--packet-tcp.c4
4 files changed, 12 insertions, 9 deletions
diff --git a/epan/packet.c b/epan/packet.c
index 9dc2a4a526..f5a323dce9 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.86 2003/01/22 06:26:36 guy Exp $
+ * $Id: packet.c,v 1.87 2003/02/27 03:56:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -277,6 +277,7 @@ dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header,
edt->pi.ipxptype = 0;
edt->pi.ctype = CT_NONE;
edt->pi.circuit_id = 0;
+ edt->pi.noreassembly_reason = "";
edt->pi.fragmented = FALSE;
edt->pi.in_error_pkt = FALSE;
edt->pi.ptype = PT_NONE;
diff --git a/epan/packet_info.h b/epan/packet_info.h
index 587ca6d062..56b154e2e9 100644
--- a/epan/packet_info.h
+++ b/epan/packet_info.h
@@ -1,7 +1,7 @@
/* packet_info.h
* Definitions for packet info structures and routines
*
- * $Id: packet_info.h,v 1.29 2003/01/22 06:26:36 guy Exp $
+ * $Id: packet_info.h,v 1.30 2003/02/27 03:56:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -131,6 +131,7 @@ typedef struct _packet_info {
guint32 ipxptype; /* IPX packet type, if this is an IPX packet */
circuit_type ctype; /* type of circuit, for protocols with a VC identifier */
guint32 circuit_id; /* circuit ID, for protocols with a VC identifier */
+ char *noreassembly_reason; /* reason why reassembly wasn't done, if any */
gboolean fragmented; /* TRUE if the protocol is only a fragment */
gboolean in_error_pkt; /* TRUE if we're inside an {ICMP,CLNP,...} error packet */
port_type ptype; /* type of the following two port numbers */
diff --git a/packet-frame.c b/packet-frame.c
index 9ff60ba1dd..37e2e4df6d 100644
--- a/packet-frame.c
+++ b/packet-frame.c
@@ -2,7 +2,7 @@
*
* Top-most dissector. Decides dissector based on Wiretap Encapsulation Type.
*
- * $Id: packet-frame.c,v 1.34 2003/01/31 01:02:03 guy Exp $
+ * $Id: packet-frame.c,v 1.35 2003/02/27 03:56:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -213,11 +213,12 @@ show_reported_bounds_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* but it wasn't in the fragment we dissected.
*/
if (check_col(pinfo->cinfo, COL_INFO))
- col_append_str(pinfo->cinfo, COL_INFO,
- "[Unreassembled Packet]");
+ col_append_fstr(pinfo->cinfo, COL_INFO,
+ "[Unreassembled Packet%s]",
+ pinfo->noreassembly_reason);
proto_tree_add_protocol_format(tree, proto_unreassembled,
- tvb, 0, 0, "[Unreassembled Packet: %s]",
- pinfo->current_proto);
+ tvb, 0, 0, "[Unreassembled Packet%s: %s]",
+ pinfo->noreassembly_reason, pinfo->current_proto);
} else {
if (check_col(pinfo->cinfo, COL_INFO))
col_append_str(pinfo->cinfo, COL_INFO,
diff --git a/packet-tcp.c b/packet-tcp.c
index 5c5c2be6fe..6e8481c27b 100644
--- a/packet-tcp.c
+++ b/packet-tcp.c
@@ -1,7 +1,7 @@
/* packet-tcp.c
* Routines for TCP packet disassembly
*
- * $Id: packet-tcp.c,v 1.173 2003/02/21 00:22:45 guy Exp $
+ * $Id: packet-tcp.c,v 1.174 2003/02/27 03:56:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1966,7 +1966,6 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* Assume, initially, that we can't desegment.
*/
pinfo->can_desegment = 0;
-
th_sum = tvb_get_ntohs(tvb, offset + 16);
if (!pinfo->fragmented && len >= reported_len) {
/* The packet isn't part of an un-reassembled fragmented datagram
@@ -2021,6 +2020,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Checksum is invalid, so we're not willing to desegment it. */
desegment_ok = FALSE;
+ pinfo->noreassembly_reason = " (incorrect TCP checksum)";
}
} else {
proto_tree_add_uint_format(tcp_tree, hf_tcp_checksum, tvb,