mirror of
https://github.com/coredns/coredns.git
synced 2026-04-19 10:25:36 -04:00
Fix data race in xfr.go (#8039)
Signed-off-by: Ryan Brewster <rpb@anthropic.com>
This commit is contained in:
@@ -146,6 +146,11 @@ func (z *Zone) SetFile(path string) {
|
||||
func (z *Zone) ApexIfDefined() ([]dns.RR, error) {
|
||||
z.RLock()
|
||||
defer z.RUnlock()
|
||||
return z.apexIfDefinedLocked()
|
||||
}
|
||||
|
||||
// apexIfDefinedLocked is ApexIfDefined without locking; caller must hold z's read lock.
|
||||
func (z *Zone) apexIfDefinedLocked() ([]dns.RR, error) {
|
||||
if z.SOA == nil {
|
||||
return nil, fmt.Errorf("no SOA")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user