From a4b8e286db78d47ee8738790137693d34b039a9f Mon Sep 17 00:00:00 2001 From: Kr328 <39107975+Kr328@users.noreply.github.com> Date: Sat, 18 May 2019 17:44:12 +0800 Subject: [PATCH] Fix: incorrect fake ip dns ttl (#187) --- dns/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/server.go b/dns/server.go index 59af5289..26b69073 100644 --- a/dns/server.go +++ b/dns/server.go @@ -60,6 +60,7 @@ func (s *Server) handleFakeIP(r *D.Msg) (msg *D.Msg, err error) { cache := s.r.cache.Get("fakeip:" + q.String()) if cache != nil { msg = cache.(*D.Msg).Copy() + setMsgTTL(msg, 1) return } @@ -72,7 +73,6 @@ func (s *Server) handleFakeIP(r *D.Msg) (msg *D.Msg, err error) { putMsgToCache(s.r.cache, "fakeip:"+q.String(), msg) putMsgToCache(s.r.cache, ip.String(), msg) - // putMsgToCache depend on msg ttl to set cache expired time, then set msg ref ttl to 1 setMsgTTL(msg, 1) }()