aboutsummaryrefslogtreecommitdiff
path: root/plugin/forward/setup.go
diff options
context:
space:
mode:
authorGravatar Chris O'Haver <cohaver@infoblox.com> 2021-06-10 04:50:20 -0400
committerGravatar GitHub <noreply@github.com> 2021-06-10 10:50:20 +0200
commit09b63df9c1584bb5389d1b681698631bcd7c19e1 (patch)
treedd83a603da82ed48204dee14935143c686c018d1 /plugin/forward/setup.go
parent79d67953332441fbfce8f8444a2a748283ae2513 (diff)
downloadcoredns-09b63df9c1584bb5389d1b681698631bcd7c19e1.tar.gz
coredns-09b63df9c1584bb5389d1b681698631bcd7c19e1.tar.zst
coredns-09b63df9c1584bb5389d1b681698631bcd7c19e1.zip
fix cidr multi-zone check (#4682)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
Diffstat (limited to 'plugin/forward/setup.go')
-rw-r--r--plugin/forward/setup.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugin/forward/setup.go b/plugin/forward/setup.go
index 3cebfe2d9..1f88daba5 100644
--- a/plugin/forward/setup.go
+++ b/plugin/forward/setup.go
@@ -93,9 +93,10 @@ func parseStanza(c *caddy.Controller) (*Forward, error) {
return f, c.ArgErr()
}
origFrom := f.from
- f.from = plugin.Host(f.from).NormalizeExact()[0] // there can only be one here, won't work with non-octet reverse
+ zones := plugin.Host(f.from).NormalizeExact()
+ f.from = zones[0] // there can only be one here, won't work with non-octet reverse
- if len(f.from) > 1 {
+ if len(zones) > 1 {
log.Warningf("Unsupported CIDR notation: '%s' expands to multiple zones. Using only '%s'.", origFrom, f.from)
}