Fix nil resource body

pull/4516/head
风扇滑翔翼 2025-03-20 15:35:49 +00:00 committed by GitHub
parent b6a3e0718f
commit 6437143bb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -141,6 +141,7 @@ func (s *ClassicNameServer) HandleResponse(ctx context.Context, packet *udp_prot
// and add EDNS0 option // and add EDNS0 option
opt := new(dnsmessage.Resource) opt := new(dnsmessage.Resource)
common.Must(opt.Header.SetEDNS0(1350, 0xfe00, true)) common.Must(opt.Header.SetEDNS0(1350, 0xfe00, true))
opt.Body = &dnsmessage.OPTResource{}
newMsg := *req.msg newMsg := *req.msg
newReq := *req newReq := *req
newMsg.Additionals = append(newMsg.Additionals, *opt) newMsg.Additionals = append(newMsg.Additionals, *opt)