EmptyResponseFromMessage: always set the RA flag, copy the RD flag

This commit is contained in:
Frank Denis 2024-10-28 23:59:01 +01:00
parent 3f551f4b66
commit 8d43ebf120

View file

@ -16,10 +16,8 @@ func EmptyResponseFromMessage(srcMsg *dns.Msg) *dns.Msg {
dstMsg := dns.Msg{MsgHdr: srcMsg.MsgHdr, Compress: true} dstMsg := dns.Msg{MsgHdr: srcMsg.MsgHdr, Compress: true}
dstMsg.Question = srcMsg.Question dstMsg.Question = srcMsg.Question
dstMsg.Response = true dstMsg.Response = true
if srcMsg.RecursionDesired { dstMsg.RecursionAvailable = true
dstMsg.RecursionAvailable = true dstMsg.RecursionDesired = srcMsg.RecursionDesired
}
dstMsg.RecursionDesired = false
dstMsg.CheckingDisabled = false dstMsg.CheckingDisabled = false
dstMsg.AuthenticatedData = false dstMsg.AuthenticatedData = false
if edns0 := srcMsg.IsEdns0(); edns0 != nil { if edns0 := srcMsg.IsEdns0(); edns0 != nil {