mirror of
https://github.com/coredns/coredns.git
synced 2025-12-07 10:55:17 -05:00
plugin/forward: Document and warn for unsupported FROM CIDR notations (#4639)
* trap unsupported FROM cidr notations Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * make is a warning Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
@@ -92,8 +92,13 @@ func parseStanza(c *caddy.Controller) (*Forward, error) {
|
||||
if !c.Args(&f.from) {
|
||||
return f, c.ArgErr()
|
||||
}
|
||||
origFrom := f.from
|
||||
f.from = plugin.Host(f.from).Normalize()[0] // there can only be one here, won't work with non-octet reverse
|
||||
|
||||
if len(f.from) > 1 {
|
||||
log.Warningf("Unsupported CIDR notation: '%s' expands to multiple zones. Using only '%s'.", origFrom, f.from)
|
||||
}
|
||||
|
||||
to := c.RemainingArgs()
|
||||
if len(to) == 0 {
|
||||
return f, c.ArgErr()
|
||||
|
||||
Reference in New Issue
Block a user