# HG changeset patch # User Kim Alvefur # Date 1497364607 -7200 # Node ID a55eb6c3b45c196ee8df7bed941b0ff2fdfb4815 # Parent 5566f82ffea413146a3d10d0746a940fa102b994 net.dns: Prevent answers from immediately expiring even if TTL=0 (see #919) diff -r 5566f82ffea4 -r a55eb6c3b45c net/dns.lua --- 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]];