aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-tcp.c
diff options
context:
space:
mode:
authorUli Heilmeier <uh@heilmeier.eu>2019-03-14 23:01:12 +0100
committerAnders Broman <a.broman58@gmail.com>2019-03-15 16:43:44 +0000
commit12ee180cd41af794320c96a312486d9cf9b21cd6 (patch)
tree81294bac30e37969d2be87fba2bf9f2cadd5d3c9 /epan/dissectors/packet-tcp.c
parent134a513dd59315d67866f238459fdee6347f1055 (diff)
TCP: Adding sequence number only once to the tree
When the TCP layer is encapsulated in an icmp error message we're adding the sequence number early. With this commit we don't add the sequence number a second time. Bug: 15533 Change-Id: Iaf983acc15a18fdb36d7baa14f8116e46418160a Reviewed-on: https://code.wireshark.org/review/32413 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-tcp.c')
-rw-r--r--epan/dissectors/packet-tcp.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index f6a66006fd..cad29dc2bd 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -5988,6 +5988,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
struct tcp_per_packet_data_t *tcppd=NULL;
proto_item *item;
proto_tree *checksum_tree;
+ gboolean icmp_ip = FALSE;
tcph = wmem_new0(wmem_packet_scope(), struct tcpheader);
tcph->th_sport = tvb_get_ntohs(tvb, offset);
@@ -6031,6 +6032,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
frame = wmem_list_frame_prev(frame);
if (proto_icmp == (gint) GPOINTER_TO_UINT(wmem_list_frame_data(frame))) {
proto_tree_add_item(tcp_tree, hf_tcp_seq, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
+ icmp_ip = TRUE;
}
}
}
@@ -6232,10 +6234,13 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
if (tcp_summary_in_tree) {
proto_item_append_text(ti, ", Seq: %u", tcph->th_seq);
}
- if(tcp_relative_seq) {
- proto_tree_add_uint_format_value(tcp_tree, hf_tcp_seq, tvb, offset + 4, 4, tcph->th_seq, "%u (relative sequence number)", tcph->th_seq);
- } else {
- proto_tree_add_uint(tcp_tree, hf_tcp_seq, tvb, offset + 4, 4, tcph->th_seq);
+
+ if (!icmp_ip) {
+ if(tcp_relative_seq) {
+ proto_tree_add_uint_format_value(tcp_tree, hf_tcp_seq, tvb, offset + 4, 4, tcph->th_seq, "%u (relative sequence number)", tcph->th_seq);
+ } else {
+ proto_tree_add_uint(tcp_tree, hf_tcp_seq, tvb, offset + 4, 4, tcph->th_seq);
+ }
}
if (tcph->th_hlen < TCPH_MIN_LEN) {