aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorGravatar Sandeep Rajan <srajan@infoblox.com> 2018-02-07 13:53:23 -0500
committerGravatar John Belamaric <jbelamaric@infoblox.com> 2018-02-07 13:53:23 -0500
commita4e0f6452d60356891408bc17ded393172daef70 (patch)
tree582ad59e36ae65293ec766f4013b6eafb7e67474 /plugin
parent82854bf09875ec9c06eba7efd5c30ee65d47c759 (diff)
downloadcoredns-a4e0f6452d60356891408bc17ded393172daef70.tar.gz
coredns-a4e0f6452d60356891408bc17ded393172daef70.tar.zst
coredns-a4e0f6452d60356891408bc17ded393172daef70.zip
plugin/rewrite: remove do set in edns0 (#1500)
* remove setdo * gofmt
Diffstat (limited to 'plugin')
-rw-r--r--plugin/rewrite/edns0.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/plugin/rewrite/edns0.go b/plugin/rewrite/edns0.go
index 7ea6f7917..2fd42cb67 100644
--- a/plugin/rewrite/edns0.go
+++ b/plugin/rewrite/edns0.go
@@ -39,7 +39,7 @@ type edns0NsidRule struct {
func setupEdns0Opt(r *dns.Msg) *dns.OPT {
o := r.IsEdns0()
if o == nil {
- r.SetEdns0(4096, true)
+ r.SetEdns0(4096, false)
o = r.IsEdns0()
}
return o
@@ -65,7 +65,6 @@ Option:
// add option if not found
if !found && (rule.action == Append || rule.action == Set) {
- o.SetDo()
o.Option = append(o.Option, &dns.EDNS0_NSID{Code: dns.EDNS0NSID, Nsid: ""})
result = RewriteDone
}
@@ -104,7 +103,6 @@ func (rule *edns0LocalRule) Rewrite(w dns.ResponseWriter, r *dns.Msg) Result {
// add option if not found
if !found && (rule.action == Append || rule.action == Set) {
- o.SetDo()
var opt dns.EDNS0_LOCAL
opt.Code = rule.code
opt.Data = rule.data
@@ -306,7 +304,6 @@ func (rule *edns0VariableRule) Rewrite(w dns.ResponseWriter, r *dns.Msg) Result
// add option if not found
if !found && (rule.action == Append || rule.action == Set) {
- o.SetDo()
var opt dns.EDNS0_LOCAL
opt.Code = rule.code
opt.Data = data
@@ -422,7 +419,6 @@ func (rule *edns0SubnetRule) Rewrite(w dns.ResponseWriter, r *dns.Msg) Result {
// add option if not found
if !found && (rule.action == Append || rule.action == Set) {
- o.SetDo()
opt := dns.EDNS0_SUBNET{Code: dns.EDNS0SUBNET}
if rule.fillEcsData(w, r, &opt) == nil {
o.Option = append(o.Option, &opt)