Skip to content

Commit 636f92b

Browse files
committed
Truncated packets cannot be parsed by miekg/dns; clear the error flag when it happens
Fixes #177
1 parent aea15a4 commit 636f92b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dnscrypt-proxy/plugins.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ func (pluginsState *PluginsState) ApplyResponsePlugins(pluginsGlobals *PluginsGl
155155
pluginsState.action = PluginsActionForward
156156
msg := dns.Msg{}
157157
if err := msg.Unpack(packet); err != nil {
158+
if len(packet) >= MinDNSPacketSize && HasTCFlag(packet) {
159+
err = nil
160+
}
158161
return packet, err
159162
}
160163
pluginsGlobals.RLock()

0 commit comments

Comments
 (0)