fix edns0 and thus dnssec

This commit is contained in:
Miek Gieben 2011-09-15 16:04:56 +02:00
parent 83817a219b
commit af63a2f45d
1 changed files with 1 additions and 10 deletions

View File

@ -107,16 +107,7 @@ Flags:
m.MsgHdr.RecursionDesired = *rd
m.Question = make([]dns.Question, 1)
if *dnssec || *nsid {
opt := dns.NewRR(dns.TypeOPT).(*dns.RR_OPT)
opt.Hdr.Rrtype = 0
opt.SetDo()
opt.SetVersion(0)
opt.SetUDPSize(dns.DefaultMsgSize)
if *nsid {
opt.SetNsid("")
}
m.Extra = make([]dns.RR, 1)
m.Extra[0] = opt
m.SetEdns0(dns.DefaultMsgSize, true)
}
for _, v := range qname {
m.Question[0] = dns.Question{v, qtype, qclass}