Truncated packets cannot be parsed by miekg/dns; clear the error flag when it happens

Fixes #177
This commit is contained in:
Frank Denis 2018-02-23 17:05:58 +01:00
parent aea15a484e
commit 636f92bae0
1 changed files with 3 additions and 0 deletions

View File

@ -155,6 +155,9 @@ func (pluginsState *PluginsState) ApplyResponsePlugins(pluginsGlobals *PluginsGl
pluginsState.action = PluginsActionForward pluginsState.action = PluginsActionForward
msg := dns.Msg{} msg := dns.Msg{}
if err := msg.Unpack(packet); err != nil { if err := msg.Unpack(packet); err != nil {
if len(packet) >= MinDNSPacketSize && HasTCFlag(packet) {
err = nil
}
return packet, err return packet, err
} }
pluginsGlobals.RLock() pluginsGlobals.RLock()