Keep the original OPT record before setting the payload size
Maybe fixes #592
This commit is contained in:
parent
77f5c41b21
commit
d49a7b462d
|
@ -35,13 +35,6 @@ func (plugin *PluginGetSetPayloadSize) Eval(pluginsState *PluginsState, msg *dns
|
||||||
pluginsState.dnssec = dnssec
|
pluginsState.dnssec = dnssec
|
||||||
pluginsState.maxPayloadSize = Min(MaxDNSUDPPacketSize-ResponseOverhead, Max(pluginsState.originalMaxPayloadSize, pluginsState.maxPayloadSize))
|
pluginsState.maxPayloadSize = Min(MaxDNSUDPPacketSize-ResponseOverhead, Max(pluginsState.originalMaxPayloadSize, pluginsState.maxPayloadSize))
|
||||||
if pluginsState.maxPayloadSize > 512 {
|
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)
|
msg.SetEdns0(uint16(pluginsState.maxPayloadSize), dnssec)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue