]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Also reconnect on ENETUNREACH.
authorAsgeir Storesund Nilsen <asgeir@twingine.no>
Thu, 4 Aug 2022 17:46:06 +0000 (19:46 +0200)
committerAsgeir Storesund Nilsen <asgeir@twingine.no>
Thu, 4 Aug 2022 17:46:06 +0000 (19:46 +0200)
Ref. #4155

pdns/dnsdist.cc

index 55943875d9d4feaaae83bcdedd651931c3915bff..709cf7161e5173b149a9d38748c2698043ff3fca 100644 (file)
@@ -1091,14 +1091,14 @@ ssize_t udpClientSendRequestToBackend(const std::shared_ptr<DownstreamState>& ss
 
   if (result == -1) {
     int savederrno = errno;
-    vinfolog("Error sending request to backend %s: %d", ss->d_config.remote.toStringWithPort(), savederrno);
+    vinfolog("Error sending request to backend %s: %s", ss->d_config.remote.toStringWithPort(), strerror(savederrno));
 
     /* This might sound silly, but on Linux send() might fail with EINVAL
        if the interface the socket was bound to doesn't exist anymore.
        We don't want to reconnect the real socket if the healthcheck failed,
        because it's not using the same socket.
     */
-    if (!healthCheck && (savederrno == EINVAL || savederrno == ENODEV)) {
+    if (!healthCheck && (savederrno == EINVAL || savederrno == ENODEV || savederrno == ENETUNREACH)) {
       ss->reconnect();
     }
   }