From: Asgeir Storesund Nilsen Date: Thu, 4 Aug 2022 17:46:06 +0000 (+0200) Subject: Also reconnect on ENETUNREACH. X-Git-Tag: rec-4.8.0-alpha1~69^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63f2d2700d5c011df2270beabe92a87168ef3c66;p=thirdparty%2Fpdns.git Also reconnect on ENETUNREACH. Ref. #4155 --- diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index 55943875d9..709cf7161e 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -1091,14 +1091,14 @@ ssize_t udpClientSendRequestToBackend(const std::shared_ptr& 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(); } }