Ethereal-dev: Re: [Ethereal-dev] packets not desegmented if not on the default port..
Guy Harris wrote:
Gigabit Ethernet interfaces (or even interfaces capable of gigabit
speeds, even if they're not running at gigabit speeds) might do TCP
checksum offloading, and some non-gigabit interfaces might do so as
well; if so, then outgoing TCP segments delivered to the packet capture
mechanism might not yet have had their checksum computed, and thus might
have bad TCP checksums.
Don't know if it's useful or the right way to do it but what about :
Index: packet-frame.c
===================================================================
RCS file: /cvsroot/ethereal/packet-frame.c,v
retrieving revision 1.34
diff -u -r1.34 packet-frame.c
--- packet-frame.c 31 Jan 2003 01:02:03 -0000 1.34
+++ packet-frame.c 12 Feb 2003 22:06:50 -0000
@@ -213,8 +213,8 @@
* 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->current_error?pinfo->current_error:"");
proto_tree_add_protocol_format(tree, proto_unreassembled,
tvb, 0, 0, "[Unreassembled Packet: %s]",
pinfo->current_proto);
Index: packet-tcp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-tcp.c,v
retrieving revision 1.171
diff -u -r1.171 packet-tcp.c
--- packet-tcp.c 28 Jan 2003 23:56:40 -0000 1.171
+++ packet-tcp.c 12 Feb 2003 22:06:52 -0000
@@ -1961,7 +1961,7 @@
* Assume, initially, that we can't desegment.
*/
pinfo->can_desegment = 0;
-
+ pinfo->current_error = "";
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
@@ -2016,6 +2016,7 @@
/* Checksum is invalid, so we're not willing to desegment it. */
desegment_ok = FALSE;
+ pinfo->current_error = ", TCP bad checksum";
}
} else {
proto_tree_add_uint_format(tcp_tree, hf_tcp_checksum, tvb,
Index: epan/packet_info.h
===================================================================
RCS file: /cvsroot/ethereal/epan/packet_info.h,v
retrieving revision 1.29
diff -u -r1.29 packet_info.h
--- epan/packet_info.h 22 Jan 2003 06:26:36 -0000 1.29
+++ epan/packet_info.h 12 Feb 2003 22:06:52 -0000
@@ -116,6 +116,7 @@
typedef struct _packet_info {
const char *current_proto; /* name of protocol currently being dissected */
+ char *current_error; /* last decoding error */
column_info *cinfo; /* Column formatting information */
frame_data *fd;
union wtap_pseudo_header *pseudo_header;