DNS: change ttl from uint32 to int32.
authorDario Lombardo <lomato@gmail.com>
Fri, 1 Apr 2016 10:39:38 +0000 (12:39 +0200)
committerMichael Mann <mmann78@netscape.net>
Mon, 4 Apr 2016 12:12:22 +0000 (12:12 +0000)
As stated in the RFC1035 the TTL is a signed int.

https://tools.ietf.org/html/rfc1035#section-3.2.1

Change-Id: I07e57309f83f1877b1b4cb6a085bc3dabf053379
Reviewed-on: https://code.wireshark.org/review/14759
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
epan/dissectors/packet-dns.c

index 47268e9e5e9a2d0e7bdea6dbbfccd85551551d76..4e99c5e4d426d7d2f44475a5b97a72d911bbccfb 100644 (file)
@@ -1511,7 +1511,7 @@ 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_item = proto_tree_add_item(rr_tree, hf_dns_rr_ttl, tvb, offset, 4, ENC_BIG_ENDIAN|ENC_TIME_TIMESPEC);
+  ttl_item = proto_tree_add_item(rr_tree, hf_dns_rr_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
   if (tvb_get_ntohl(tvb, offset) & 0x80000000) {
     expert_add_info(pinfo, ttl_item, &ei_ttl_negative);
   }
@@ -4386,7 +4386,7 @@ proto_register_dns(void)
 
     { &hf_dns_rr_ttl,
       { "Time to live", "dns.resp.ttl",
-        FT_UINT32, BASE_DEC, NULL, 0x0,
+        FT_INT32, BASE_DEC, NULL, 0x0,
         "Response TTL", HFILL }},
 
     { &hf_dns_rr_len,