Skip to content

Commit a143fb0

Browse files
committed
Forward plugin: if we got nothing but errors, return the last response we got
fixes #2882
1 parent bc5fdd5 commit a143fb0

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

dnscrypt-proxy/plugin_forward.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,19 +322,19 @@ func (plugin *PluginForward) Eval(pluginsState *PluginsState, msg *dns.Msg) erro
322322
continue
323323
}
324324
}
325-
if len(sequence) > 0 {
326-
switch respMsg.Rcode {
327-
case dns.RcodeNameError, dns.RcodeRefused, dns.RcodeNotAuth:
328-
continue
329-
}
330-
}
331325
if edns0 := respMsg.IsEdns0(); edns0 == nil || !edns0.Do() {
332326
respMsg.AuthenticatedData = false
333327
}
334328
respMsg.Id = msg.Id
335329
pluginsState.synthResponse = respMsg
336330
pluginsState.action = PluginsActionSynth
337331
pluginsState.returnCode = PluginsReturnCodeForward
332+
if len(sequence) > 0 {
333+
switch respMsg.Rcode {
334+
case dns.RcodeNameError, dns.RcodeRefused, dns.RcodeNotAuth:
335+
continue
336+
}
337+
}
338338
return nil
339339
}
340340
return err

0 commit comments

Comments
 (0)