aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2021-03-18 15:39:40 +0100
committerGravatar GitHub <noreply@github.com> 2021-03-18 15:39:40 +0100
commit8faca26873baf063480793b00eebdd8121ce3229 (patch)
tree5480cc49c1e6bbfd042e1293040c17fbe4de1f7a /plugin
parentdeb09c8905dbb00b47dbe873a296897558506f7c (diff)
downloadcoredns-8faca26873baf063480793b00eebdd8121ce3229.tar.gz
coredns-8faca26873baf063480793b00eebdd8121ce3229.tar.zst
coredns-8faca26873baf063480793b00eebdd8121ce3229.zip
plugin/bind: tweak error messages (#4532)
When the interface doesn't exist you get: plugin/bind: not a valid IP address: eth0 Fix the wording that this can also be interface name. Also %q the argument in the error mesg. Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin')
-rw-r--r--plugin/bind/setup.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugin/bind/setup.go b/plugin/bind/setup.go
index b2a37551c..d75d6c0ff 100644
--- a/plugin/bind/setup.go
+++ b/plugin/bind/setup.go
@@ -33,7 +33,7 @@ func setup(c *caddy.Controller) error {
isIface = true
addrs, err := iface.Addrs()
if err != nil {
- return plugin.Error("bind", fmt.Errorf("failed to get the IP(s) of the interface: %s", arg))
+ return plugin.Error("bind", fmt.Errorf("failed to get the IP addresses of the interface: %q", arg))
}
for _, addr := range addrs {
if ipnet, ok := addr.(*net.IPNet); ok {
@@ -46,7 +46,7 @@ func setup(c *caddy.Controller) error {
}
if !isIface {
if net.ParseIP(arg) == nil {
- return plugin.Error("bind", fmt.Errorf("not a valid IP address: %s", arg))
+ return plugin.Error("bind", fmt.Errorf("not a valid IP address or interface name: %q", arg))
}
all = append(all, arg)
}