From 376f2ade2aedc308a9e989f0f1a548abd419e4b3 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Mon, 24 Mar 2025 08:54:54 +0100 Subject: [PATCH] - Fix #1254: `send failed: Socket is not connected` and `remote address is 0.0.0.0 port 53`. --- doc/Changelog | 4 ++++ util/netevent.c | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/doc/Changelog b/doc/Changelog index 0400c54cd..6e90373aa 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +24 March 2025: Wouter + - Fix #1254: `send failed: Socket is not connected` and + `remote address is 0.0.0.0 port 53`. + 21 March 2025: Wouter - Fix #1253: Cache entries fail to be removed from Redis cachedb backend with unbound-control flush* +c. diff --git a/util/netevent.c b/util/netevent.c index 998775803..5e4095061 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -369,6 +369,15 @@ udp_send_errno_needs_log(struct sockaddr* addr, socklen_t addrlen) (struct sockaddr_storage*)addr, addrlen) && verbosity < VERB_DETAIL) return 0; +# ifdef ENOTCONN + /* For 0.0.0.0, ::0 targets it can return that socket is not connected. + * This can be ignored, and the address skipped. It remains + * possible to send there for completeness in configuration. */ + if(errno == ENOTCONN && addr_is_any( + (struct sockaddr_storage*)addr, addrlen) && + verbosity < VERB_DETAIL) + return 0; +# endif return 1; }