From ea2e9279993d74a31d4a2d04a976ae0fc819a94d Mon Sep 17 00:00:00 2001 From: "Mohammad H. AlShami" Date: Fri, 26 Jan 2024 19:48:16 -0500 Subject: [PATCH] Allow setting the DO flag without having to explicitly enable an EDNS option --- main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 92431a9..2a6105b 100644 --- a/main.go +++ b/main.go @@ -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)) }