Skip to content

Commit b531fc6

Browse files
committed
Drop responses that fail plugin processing
Return nil from the resolver callback when ApplyResponsePlugins errors, and stop suppressing unpack errors for truncated packets.
1 parent b5742bc commit b531fc6

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

dnscrypt-proxy/plugins.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,6 @@ func (pluginsState *PluginsState) ApplyResponsePlugins(
340340
) ([]byte, error) {
341341
msg := dns.Msg{Data: packet}
342342
if err := msg.Unpack(); err != nil {
343-
if len(packet) >= MinDNSPacketSize && HasTCFlag(packet) {
344-
err = nil
345-
}
346343
return packet, err
347344
}
348345
switch Rcode(packet) {

dnscrypt-proxy/proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ func (proxy *Proxy) processIncomingQuery(
876876
// Process the response through plugins
877877
processedResponse, err := processPlugins(proxy, &pluginsState, query, serverInfo, response)
878878
if err != nil {
879-
return response
879+
return nil
880880
}
881881

882882
response = processedResponse

0 commit comments

Comments
 (0)