From fdc2f3c4746525b18683136dc24727803db971fb Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 3 Oct 2018 16:41:37 +0200 Subject: [PATCH] Revert "Keep the original OPT record before setting the payload size" This reverts commit d49a7b462dc7e134cb346eaa3fbacc125b0746e1. --- dnscrypt-proxy/plugin_get_set_payload_size.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dnscrypt-proxy/plugin_get_set_payload_size.go b/dnscrypt-proxy/plugin_get_set_payload_size.go index 7f551e59..d866120f 100644 --- a/dnscrypt-proxy/plugin_get_set_payload_size.go +++ b/dnscrypt-proxy/plugin_get_set_payload_size.go @@ -35,6 +35,13 @@ func (plugin *PluginGetSetPayloadSize) Eval(pluginsState *PluginsState, msg *dns pluginsState.dnssec = dnssec pluginsState.maxPayloadSize = Min(MaxDNSUDPPacketSize-ResponseOverhead, Max(pluginsState.originalMaxPayloadSize, pluginsState.maxPayloadSize)) if pluginsState.maxPayloadSize > 512 { + extra2 := []dns.RR{} + for _, extra := range msg.Extra { + if extra.Header().Rrtype != dns.TypeOPT { + extra2 = append(extra2, extra) + } + } + msg.Extra = extra2 msg.SetEdns0(uint16(pluginsState.maxPayloadSize), dnssec) } return nil