[6.0] e89baa60f Accept all ENET* ECONN* EHOST* errnos

Reza Naghibi reza at naghibi.com
Wed Apr 28 18:19:08 UTC 2021


commit e89baa60fa77df5e0608bb105e3f1de3291012be
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Mar 2 13:59:50 2021 +0100

    Accept all ENET* ECONN* EHOST* errnos
    
    ... documented on Linux as POSIX.1
    
    The exception here is ECONNREFUSED which so far we only tolerate for
    Solaris and which seems to make sense for connect() only.
    
    To be discussed in #3539

diff --git a/lib/libvarnish/vtcp.c b/lib/libvarnish/vtcp.c
index 02bbe7320..89450c52e 100644
--- a/lib/libvarnish/vtcp.c
+++ b/lib/libvarnish/vtcp.c
@@ -576,6 +576,13 @@ VTCP_Check(ssize_t a)
 	 * some time. */
 	if (errno == ETIMEDOUT)
 		return (1);
+	/* #3539 various errnos documented on linux as POSIX.1 */
+	if (errno == ENETDOWN || errno == ENETUNREACH || errno == ENETRESET ||
+	    errno == ECONNABORTED || /* ECONNRESET see above */
+	    errno == EHOSTUNREACH || errno == EHOSTDOWN) {
+		return (1);
+	}
+
 #if (defined (__SVR4) && defined (__sun))
 	if (errno == ECONNREFUSED)	// in r02702.vtc
 		return (1);


More information about the varnish-commit mailing list