aboutsummaryrefslogtreecommitdiff
path: root/plugin/file/zone.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2020-07-07 21:38:07 +0200
committerGravatar GitHub <noreply@github.com> 2020-07-07 12:38:07 -0700
commit68f1dd5ddf0451cc3a1b24a72c2965b8d896ffba (patch)
treedfac4d4c60f1e3a088737e15119c7648f056e407 /plugin/file/zone.go
parent435d27b58d813ccc01ecc6d8620b78929c516c25 (diff)
downloadcoredns-68f1dd5ddf0451cc3a1b24a72c2965b8d896ffba.tar.gz
coredns-68f1dd5ddf0451cc3a1b24a72c2965b8d896ffba.tar.zst
coredns-68f1dd5ddf0451cc3a1b24a72c2965b8d896ffba.zip
Implement notifies for transfer plugin (#3972)
* Fix notifies in transfer plugin Signed-off-by: Miek Gieben <miek@miek.nl> * Make it compile Signed-off-by: Miek Gieben <miek@miek.nl> * Port more plugins Signed-off-by: Miek Gieben <miek@miek.nl> * golint Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * Fix notifies in transfer plugin Signed-off-by: Miek Gieben <miek@miek.nl> * Make it compile Signed-off-by: Miek Gieben <miek@miek.nl> * Port more plugins Signed-off-by: Miek Gieben <miek@miek.nl> * golint Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * really fix test Signed-off-by: Miek Gieben <miek@miek.nl> * Implement ixfr fallback and unify file and auto for transfering Signed-off-by: Miek Gieben <miek@miek.nl> * Add transfer tests copied and modified from #3452 Signed-off-by: Miek Gieben <miek@miek.nl> * Test correct selection of plugin Signed-off-by: Miek Gieben <miek@miek.nl> * add upstream back in Signed-off-by: Miek Gieben <miek@miek.nl> * Implement ixfr fallback and unify file and auto for transfering Signed-off-by: Miek Gieben <miek@miek.nl> * fix test Signed-off-by: Miek Gieben <miek@miek.nl> * properly merge Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/file/zone.go')
-rw-r--r--plugin/file/zone.go25
1 files changed, 0 insertions, 25 deletions
diff --git a/plugin/file/zone.go b/plugin/file/zone.go
index 62720abb4..aa5f3cac0 100644
--- a/plugin/file/zone.go
+++ b/plugin/file/zone.go
@@ -2,7 +2,6 @@ package file
import (
"fmt"
- "net"
"path/filepath"
"strings"
"sync"
@@ -10,7 +9,6 @@ import (
"github.com/coredns/coredns/plugin/file/tree"
"github.com/coredns/coredns/plugin/pkg/upstream"
- "github.com/coredns/coredns/request"
"github.com/miekg/dns"
)
@@ -26,7 +24,6 @@ type Zone struct {
sync.RWMutex
- TransferTo []string
StartupOnce sync.Once
TransferFrom []string
@@ -58,7 +55,6 @@ func NewZone(name, file string) *Zone {
// Copy copies a zone.
func (z *Zone) Copy() *Zone {
z1 := NewZone(z.origin, z.file)
- z1.TransferTo = z.TransferTo
z1.TransferFrom = z.TransferFrom
z1.Expired = z.Expired
@@ -69,7 +65,6 @@ func (z *Zone) Copy() *Zone {
// CopyWithoutApex copies zone z without the Apex records.
func (z *Zone) CopyWithoutApex() *Zone {
z1 := NewZone(z.origin, z.file)
- z1.TransferTo = z.TransferTo
z1.TransferFrom = z.TransferFrom
z1.Expired = z.Expired
@@ -134,26 +129,6 @@ func (z *Zone) SetFile(path string) {
z.Unlock()
}
-// TransferAllowed checks if incoming request for transferring the zone is allowed according to the ACLs.
-func (z *Zone) TransferAllowed(state request.Request) bool {
- for _, t := range z.TransferTo {
- if t == "*" {
- return true
- }
- // If remote IP matches we accept.
- remote := state.IP()
- to, _, err := net.SplitHostPort(t)
- if err != nil {
- continue
- }
- if to == remote {
- return true
- }
- }
- // TODO(miek): future matching against IP/CIDR notations
- return false
-}
-
// ApexIfDefined returns the apex nodes from z. The SOA record is the first record, if it does not exist, an error is returned.
func (z *Zone) ApexIfDefined() ([]dns.RR, error) {
z.RLock()