Revert "Keep the original OPT record before setting the payload size"

This reverts commit d49a7b462d.
This commit is contained in:
Frank Denis 2018-10-03 16:41:37 +02:00
parent 5cb7d8df35
commit fdc2f3c474
1 changed files with 7 additions and 0 deletions

View File

@ -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