From: Ondřej Surý Date: Fri, 6 Mar 2026 10:08:40 +0000 (+0100) Subject: Fix wrong errno value passed in route_socket() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=273f95c65ce709d03e6540afe6aac0973850e587;p=thirdparty%2Fbind9.git Fix wrong errno value passed in route_socket() bind() returns -1 on failure and sets errno. The code was passing the return value `r` (which is always -1) to isc_errno_toresult() instead of `errno`, causing incorrect error codes to be reported for netlink bind failures. --- diff --git a/lib/isc/netmgr/udp.c b/lib/isc/netmgr/udp.c index f0e21cb262d..6f544e0d7d1 100644 --- a/lib/isc/netmgr/udp.c +++ b/lib/isc/netmgr/udp.c @@ -384,8 +384,9 @@ route_socket(uv_os_sock_t *fdp) { sa.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR; r = bind(fd, (struct sockaddr *)&sa, sizeof(sa)); if (r < 0) { + isc_result_t result = isc_errno_toresult(errno); isc__nm_closesocket(fd); - return isc_errno_toresult(r); + return result; } #endif