aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dns.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2019-12-08 20:26:50 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2019-12-08 20:24:21 +0000
commit803d47fd50c9f5e76cd0a43f34eb587e0f1d6804 (patch)
tree0778131ffca008c099db5242afab98a72248afa4 /epan/dissectors/packet-dns.c
parent9110c59322b7acd7eb256754336d63cecbb3789d (diff)
dns: Unify display of TTL with time_secs_to_str()
Use same format for "Time to live" as for other ttl values by appending the time_secs_to_str() output to the number of seconds. Ping-Bug: 16263 Change-Id: Ie55bbf27bf9c44554d391b395d23c478ad401d98 Reviewed-on: https://code.wireshark.org/review/35358 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'epan/dissectors/packet-dns.c')
-rw-r--r--epan/dissectors/packet-dns.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c
index 7cafa22021..6293d093c1 100644
--- a/epan/dissectors/packet-dns.c
+++ b/epan/dissectors/packet-dns.c
@@ -1594,9 +1594,8 @@ add_rr_to_tree(proto_tree *rr_tree, tvbuff_t *tvb, int offset,
proto_tree_add_item(rr_tree, hf_dns_rr_class, tvb, offset, 2, ENC_BIG_ENDIAN);
}
offset += 2;
- ttl_value = tvb_get_ntohl(tvb, offset);
- ttl_item = proto_tree_add_uint_format_value(rr_tree, hf_dns_rr_ttl, tvb, offset, 4, ttl_value,
- "%s", unsigned_time_secs_to_str(wmem_packet_scope(), ttl_value));
+ ttl_item = proto_tree_add_item_ret_uint(rr_tree, hf_dns_rr_ttl, tvb, offset, 4, ENC_BIG_ENDIAN, &ttl_value);
+ proto_item_append_text(ttl_item, " (%s)", signed_time_secs_to_str(wmem_packet_scope(), ttl_value));
if (ttl_value & 0x80000000) {
expert_add_info(pinfo, ttl_item, &ei_ttl_high_bit_set);
}