From 23c7d5f4e7dc6c087f2b895f5d1907d7f980eeac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Thu, 22 Jun 2017 15:59:23 -0400 Subject: dns: Put request/response tracking last in the tree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I56b99941db63ca87cd233112967592c948d2a390 Reviewed-on: https://code.wireshark.org/review/22361 Petri-Dish: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/dissectors/packet-dns.c | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'epan/dissectors') diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c index 74ace7f794..44d2084cf6 100644 --- a/epan/dissectors/packet-dns.c +++ b/epan/dissectors/packet-dns.c @@ -3704,30 +3704,6 @@ dissect_dns_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dns_trans->req_time=pinfo->abs_ts; } - /* print state tracking in the tree */ - if (!(flags&F_RESPONSE)) { - /* This is a request */ - if (dns_trans->rep_frame) { - proto_item *it; - - it=proto_tree_add_uint(dns_tree, hf_dns_response_in, tvb, 0, 0, dns_trans->rep_frame); - PROTO_ITEM_SET_GENERATED(it); - } - } else { - /* This is a reply */ - if (dns_trans->req_frame) { - proto_item *it; - nstime_t ns; - - it=proto_tree_add_uint(dns_tree, hf_dns_response_to, tvb, 0, 0, dns_trans->req_frame); - PROTO_ITEM_SET_GENERATED(it); - - nstime_delta(&ns, &pinfo->abs_ts, &dns_trans->req_time); - it=proto_tree_add_time(dns_tree, hf_dns_time, tvb, 0, 0, &ns); - PROTO_ITEM_SET_GENERATED(it); - } - } - if (is_tcp) { /* Put the length indication into the tree. */ proto_tree_add_item(dns_tree, hf_dns_length, tvb, offset - 2, 2, ENC_BIG_ENDIAN); @@ -3855,6 +3831,30 @@ dissect_dns_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pinfo, is_mdns); } + /* print state tracking in the tree */ + if (!(flags&F_RESPONSE)) { + /* This is a request */ + if (dns_trans->rep_frame) { + proto_item *it; + + it=proto_tree_add_uint(dns_tree, hf_dns_response_in, tvb, 0, 0, dns_trans->rep_frame); + PROTO_ITEM_SET_GENERATED(it); + } + } else { + /* This is a reply */ + if (dns_trans->req_frame) { + proto_item *it; + nstime_t ns; + + it=proto_tree_add_uint(dns_tree, hf_dns_response_to, tvb, 0, 0, dns_trans->req_frame); + PROTO_ITEM_SET_GENERATED(it); + + nstime_delta(&ns, &pinfo->abs_ts, &dns_trans->req_time); + it=proto_tree_add_time(dns_tree, hf_dns_time, tvb, 0, 0, &ns); + PROTO_ITEM_SET_GENERATED(it); + } + } + /* Collect stats */ if (is_mdns) { /* TODO */ -- cgit v1.2.1