]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: inet: report the faulty interface name in "bind" errors
authorWilly Tarreau <w@1wt.eu>
Thu, 14 Oct 2021 09:41:19 +0000 (11:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 14 Oct 2021 19:22:52 +0000 (21:22 +0200)
When a "bind ... interface foo" statement fails, let's report the
interface name in the error message to help locating it in the file.

src/sock_inet.c

index fb6998143f1025d7d74987a2701b3161fbbe223d..1402dd076d79831555014996e58f1ca36e9b867c 100644 (file)
@@ -362,7 +362,7 @@ int sock_inet_bind_receiver(struct receiver *rx, char **errmsg)
                if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE,
                               rx->settings->interface,
                               strlen(rx->settings->interface) + 1) == -1) {
-                       memprintf(errmsg, "cannot bind receiver to device (%s)", strerror(errno));
+                       memprintf(errmsg, "cannot bind receiver to device '%s' (%s)", rx->settings->interface, strerror(errno));
                        err |= ERR_WARN;
                }
        }