Wireshark-dev: [Wireshark-dev] [PATCH] bugfix : ICMP unreachable and tcp seq not shown
Hi all,
This patch should resolve the problem of the TCP seq number which is
not shown when dissecting an ICMP Unreachable packet.
In fact, the seq number is not added directly to the tree because of the
seq analysis. However within an ICMP dissection we never reach the code
where the seq number will be added to the tree.
One solution is to check whether the packet has been treated by the ICMP
dissector in which case TCP seq number should be added directly to the
tree. We can find this information in pinfo->layer_names.
It is related to the bug 595.
Sebastien Tandel
Index: epan/dissectors/packet-tcp.c
===================================================================
--- epan/dissectors/packet-tcp.c (révision 20122)
+++ epan/dissectors/packet-tcp.c (copie de travail)
@@ -2163,6 +2163,13 @@
"Destination port: %s (%u)", get_tcp_port(tcph->th_dport), tcph->th_dport);
proto_tree_add_uint_hidden(tcp_tree, hf_tcp_port, tvb, offset, 2, tcph->th_sport);
proto_tree_add_uint_hidden(tcp_tree, hf_tcp_port, tvb, offset + 2, 2, tcph->th_dport);
+
+ if (pinfo->layer_names != NULL && pinfo->layer_names->str != NULL) {
+ /* use of strstr because g_strrstr is only present in glib2.0 and
+ * g_str_has_suffix in glib2.2*/
+ if (strstr(pinfo->layer_names->str, "icmp:ip") != NULL)
+ proto_tree_add_item(tcp_tree, hf_tcp_seq, tvb, offset + 4, 4, FALSE);
+ }
}
/* Set the source and destination port numbers as soon as we get them,