From c419b5031df1ecdcf749f3f0c091a10c603358f1 Mon Sep 17 00:00:00 2001 From: dmathieu <42@dmathieu.com> Date: Thu, 1 Feb 2018 16:13:05 +0100 Subject: [PATCH] log all the available interfaces when none were found --- main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 856ccf2e7a..c336c3e5d9 100644 --- a/main.go +++ b/main.go @@ -474,7 +474,13 @@ func LookupExtIface(ifname string, ifregex string) (*backend.ExternalInterface, // Check that nothing was matched if iface == nil { - return nil, fmt.Errorf("Could not match pattern %s to any of the available network interfaces", ifregex) + var availableFaces []string + for _, f := range ifaces { + ip, _ := ip.GetIfaceIP4Addr(&f) // We can safely ignore errors. We just won't log any ip + availableFaces = append(availableFaces, fmt.Sprintf("%s:%s", f.Name, ip)) + } + + return nil, fmt.Errorf("Could not match pattern %s to any of the available network interfaces (%s)", ifregex, strings.Join(availableFaces, ", ")) } } else { log.Info("Determining IP address of default interface")