Diff

net/dns.lua @ 8263:9b52b1f19b51

net.dns: Correctly apply lower bound of RTT (thanks Ge0rG)
author Kim Alvefur <zash@zash.se>
date Sun, 24 Sep 2017 01:04:56 +0200
parent 8164:a395957f3bf2
child 8427:1371518f70ff
child 8421:3d21c63ec03f
line wrap: on
line diff
--- a/net/dns.lua	Sat Sep 23 23:32:08 2017 +0100
+++ b/net/dns.lua	Sun Sep 24 01:04:56 2017 +0200
@@ -504,7 +504,7 @@
 	rr.ttl      = 0x10000*self:word() + self:word();
 	rr.rdlength = self:word();
 
-	rr.tod = self.time + math.min(rr.ttl, 1);
+	rr.tod = self.time + math.max(rr.ttl, 1);
 
 	local remember = self.offset;
 	local rr_parser = self[dns.type[rr.type]];