Diff

net/dns.lua @ 8163:a55eb6c3b45c

net.dns: Prevent answers from immediately expiring even if TTL=0 (see #919)
author Kim Alvefur <zash@zash.se>
date Tue, 13 Jun 2017 16:36:47 +0200
parent 8151:2c65f8be38aa
child 8164:a395957f3bf2
line wrap: on
line diff
--- a/net/dns.lua	Tue May 30 20:52:22 2017 +0100
+++ b/net/dns.lua	Tue Jun 13 16:36:47 2017 +0200
@@ -513,7 +513,7 @@
 	rr.ttl      = 0x10000*self:word() + self:word();
 	rr.rdlength = self:word();
 
-	rr.tod = self.time + rr.ttl;
+	rr.tod = self.time + math.min(rr.ttl, 1);
 
 	local remember = self.offset;
 	local rr_parser = self[dns.type[rr.type]];