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:
parent
5d80a6e21e
commit
0348b019be
3 changed files with 9 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue