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>
This commit is contained in:
Stig Bjørlykke 2019-12-08 20:26:50 +01:00
parent 9110c59322
commit 803d47fd50
1 changed files with 2 additions and 3 deletions

View File

@ -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);
}