Do not cache truncated messages

Fixes #774
This commit is contained in:
Frank Denis 2019-04-01 08:19:26 +02:00
parent a389067d29
commit 8b608403b1
1 changed files with 3 additions and 0 deletions

View File

@ -52,6 +52,9 @@ func (plugin *PluginCacheResponse) Eval(pluginsState *PluginsState, msg *dns.Msg
if msg.Rcode != dns.RcodeSuccess && msg.Rcode != dns.RcodeNameError && msg.Rcode != dns.RcodeNotAuth { if msg.Rcode != dns.RcodeSuccess && msg.Rcode != dns.RcodeNameError && msg.Rcode != dns.RcodeNotAuth {
return nil return nil
} }
if msg.Truncated {
return nil
}
cacheKey, err := computeCacheKey(pluginsState, msg) cacheKey, err := computeCacheKey(pluginsState, msg)
if err != nil { if err != nil {
return err return err