From: Willy Tarreau Date: Thu, 14 Oct 2021 09:41:19 +0000 (+0200) Subject: MINOR: inet: report the faulty interface name in "bind" errors X-Git-Tag: v2.5-dev10~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f78b52eb7d0f6a5f4cfe163be11b4b23113a4b37;p=thirdparty%2Fhaproxy.git MINOR: inet: report the faulty interface name in "bind" errors When a "bind ... interface foo" statement fails, let's report the interface name in the error message to help locating it in the file. --- diff --git a/src/sock_inet.c b/src/sock_inet.c index fb6998143f..1402dd076d 100644 --- a/src/sock_inet.c +++ b/src/sock_inet.c @@ -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; } }