mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
plugin/rewrite: don't set or use ecs.DraftOption (#1262)
* plugin/rewrite: don't set or use ecs.DraftOption Don't know why we are accessing this and explicitally setting it to False (the default). Any kill with fire - makes the build, build again. * remove this
This commit is contained in:
@@ -368,7 +368,6 @@ func (rule *edns0SubnetRule) fillEcsData(w dns.ResponseWriter, r *dns.Msg,
|
|||||||
return fmt.Errorf("unable to fill data for EDNS0 subnet due to invalid IP family")
|
return fmt.Errorf("unable to fill data for EDNS0 subnet due to invalid IP family")
|
||||||
}
|
}
|
||||||
|
|
||||||
ecs.DraftOption = false
|
|
||||||
ecs.Family = uint16(family)
|
ecs.Family = uint16(family)
|
||||||
ecs.SourceScope = 0
|
ecs.SourceScope = 0
|
||||||
|
|
||||||
|
|||||||
@@ -364,9 +364,6 @@ func optsEqual(a, b []dns.EDNS0) bool {
|
|||||||
if !bytes.Equal(aa.Address, bb.Address) {
|
if !bytes.Equal(aa.Address, bb.Address) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if aa.DraftOption != bb.DraftOption {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -479,7 +476,7 @@ func TestRewriteEDNS0Subnet(t *testing.T) {
|
|||||||
SourceNetmask: 0x18,
|
SourceNetmask: 0x18,
|
||||||
SourceScope: 0x0,
|
SourceScope: 0x0,
|
||||||
Address: []byte{0x0A, 0xF0, 0x00, 0x00},
|
Address: []byte{0x0A, 0xF0, 0x00, 0x00},
|
||||||
DraftOption: false}},
|
}},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
&test.ResponseWriter{},
|
&test.ResponseWriter{},
|
||||||
@@ -490,7 +487,7 @@ func TestRewriteEDNS0Subnet(t *testing.T) {
|
|||||||
SourceNetmask: 0x20,
|
SourceNetmask: 0x20,
|
||||||
SourceScope: 0x0,
|
SourceScope: 0x0,
|
||||||
Address: []byte{0x0A, 0xF0, 0x00, 0x01},
|
Address: []byte{0x0A, 0xF0, 0x00, 0x01},
|
||||||
DraftOption: false}},
|
}},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
&test.ResponseWriter{},
|
&test.ResponseWriter{},
|
||||||
@@ -501,7 +498,7 @@ func TestRewriteEDNS0Subnet(t *testing.T) {
|
|||||||
SourceNetmask: 0x0,
|
SourceNetmask: 0x0,
|
||||||
SourceScope: 0x0,
|
SourceScope: 0x0,
|
||||||
Address: []byte{0x00, 0x00, 0x00, 0x00},
|
Address: []byte{0x00, 0x00, 0x00, 0x00},
|
||||||
DraftOption: false}},
|
}},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
&test.ResponseWriter6{},
|
&test.ResponseWriter6{},
|
||||||
@@ -513,7 +510,7 @@ func TestRewriteEDNS0Subnet(t *testing.T) {
|
|||||||
SourceScope: 0x0,
|
SourceScope: 0x0,
|
||||||
Address: []byte{0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
Address: []byte{0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||||
DraftOption: false}},
|
}},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
&test.ResponseWriter6{},
|
&test.ResponseWriter6{},
|
||||||
@@ -525,7 +522,7 @@ func TestRewriteEDNS0Subnet(t *testing.T) {
|
|||||||
SourceScope: 0x0,
|
SourceScope: 0x0,
|
||||||
Address: []byte{0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
Address: []byte{0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x42, 0x00, 0xff, 0xfe, 0xca, 0x4c, 0x65},
|
0x00, 0x42, 0x00, 0xff, 0xfe, 0xca, 0x4c, 0x65},
|
||||||
DraftOption: false}},
|
}},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
&test.ResponseWriter6{},
|
&test.ResponseWriter6{},
|
||||||
@@ -537,7 +534,7 @@ func TestRewriteEDNS0Subnet(t *testing.T) {
|
|||||||
SourceScope: 0x0,
|
SourceScope: 0x0,
|
||||||
Address: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
Address: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||||
DraftOption: false}},
|
}},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user