diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2025-12-02 15:02:01 +1100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2025-12-02 23:05:08 +0100 |
| commit | 10e850a8602b44ef110f5504062f49dbe0cb2e77 (patch) | |
| tree | f17122e2a477884fc0d45b389fe98a6c28e4c040 | |
| parent | 1a834879a2f7ab138c12cd65c610f71eece8a939 (diff) | |
| download | passt-10e850a8602b44ef110f5504062f49dbe0cb2e77.tar passt-10e850a8602b44ef110f5504062f49dbe0cb2e77.tar.gz passt-10e850a8602b44ef110f5504062f49dbe0cb2e77.tar.bz2 passt-10e850a8602b44ef110f5504062f49dbe0cb2e77.tar.lz passt-10e850a8602b44ef110f5504062f49dbe0cb2e77.tar.xz passt-10e850a8602b44ef110f5504062f49dbe0cb2e77.tar.zst passt-10e850a8602b44ef110f5504062f49dbe0cb2e77.zip | |
util: Correct error message on SO_BINDTODEVICE failure
The warning message we print of SO_BINDTODEVICE fails is incorrect: we
include EPOLL_TYPE_STR(proto), but the proto variable is not an epoll type
so this will generate misleading garbage. This has been wrong ever since
340164445 but the message is rare enough that we never noticed.
Correct that, and reword the message a bit for clarity while we're
there.
Fixes: 340164445341 ("epoll: Generalize epoll_ref to cover things other than sockets")
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
| -rw-r--r-- | util.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -126,9 +126,10 @@ int sock_l4_sa(const struct ctx *c, enum epoll_type type, char str[SOCKADDR_STRLEN]; ret = -errno; - warn("Can't bind %s socket for %s to %s, closing", - EPOLL_TYPE_STR(proto), - sockaddr_ntop(sa, str, sizeof(str)), ifname); + warn("SO_BINDTODEVICE %s failed for %s on %s: %s", + ifname, EPOLL_TYPE_STR(type), + sockaddr_ntop(sa, str, sizeof(str)), + strerror_(-ret)); close(fd); return ret; } |
