]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #1254: `send failed: Socket is not connected` and
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 24 Mar 2025 07:54:54 +0000 (08:54 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 24 Mar 2025 07:54:54 +0000 (08:54 +0100)
  `remote address is 0.0.0.0 port 53`.

doc/Changelog
util/netevent.c

index 0400c54cdadecbe8fa51c33b73d3ce124da4f285..6e90373aa7cd08c618645814d68257f34773d3fd 100644 (file)
@@ -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.
index 9987758039aa409c9955d86d7ddfe9d47524f84b..5e4095061a9e5aaeb43c58cc6d881807d32ee099 100644 (file)
@@ -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;
 }