Skip to content

Commit

Permalink
Allow setting the DO flag without having to explicitly enable an EDNS…
Browse files Browse the repository at this point in the history
… option
  • Loading branch information
mohshami committed Jan 27, 2024
1 parent bbd6081 commit ea2e927
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,17 @@ func main() {
{Name: domain + ".", Qtype: rrType, Qclass: class},
}

opt := getOrCreateOpt(req, do)

if subnetOpt != nil {
opt := getOrCreateOpt(req, do)
opt.Option = append(opt.Option, subnetOpt)
}

if ednsOpt != nil {
opt := getOrCreateOpt(req, do)
opt.Option = append(opt.Option, ednsOpt)
}

if padding {
opt := getOrCreateOpt(req, do)
opt.Option = append(opt.Option, newEDNS0Padding(req))
}

Expand Down

0 comments on commit ea2e927

Please sign in to comment.