[master] f77fc42a4 Merger from VTEST:

Poul-Henning Kamp phk at FreeBSD.org
Thu Dec 3 14:50:07 UTC 2020


commit f77fc42a448c837d95ff01c595c458f584b27e27
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Nov 23 10:41:12 2020 +0000

    Merger from VTEST:
    
        vtc_haproxy: VTCP_listen_on 127.0.0.1 instead of localhost
    
        Always bind vtc_haproxy with 127.0.0.1 instead of binding on ::1 or
        127.0.0.1 depending on the environment.
    
        This is related to bug https://github.com/haproxy/haproxy/issues/937
        here the ipv6 and ipv4 are randomly mixed which can't work with socks4.

diff --git a/bin/varnishtest/vtc_haproxy.c b/bin/varnishtest/vtc_haproxy.c
index b7f467cb7..46b4001da 100644
--- a/bin/varnishtest/vtc_haproxy.c
+++ b/bin/varnishtest/vtc_haproxy.c
@@ -520,7 +520,7 @@ haproxy_create_mcli(struct haproxy *h)
 	const char *err;
 	char buf[128], addr[128], port[128];
 
-	sock = VTCP_listen_on("localhost:0", NULL, 100, &err);
+	sock = VTCP_listen_on("127.0.0.1:0", NULL, 100, &err);
 	if (err != NULL)
 		vtc_fatal(h->vl,
 			  "Create listen socket failed: %s", err);
@@ -592,7 +592,7 @@ haproxy_new(const char *name)
 	 * May be useful to simulate an unreachable server.
 	 */
 	bprintf(h->closed_sock, "%s_closed", h->name);
-	closed_sock = VTCP_listen_on("localhost:0", NULL, 100, &err);
+	closed_sock = VTCP_listen_on("127.0.0.1:0", NULL, 100, &err);
 	if (err != NULL)
 		vtc_fatal(h->vl,
 			"Create listen socket failed: %s", err);
@@ -848,7 +848,7 @@ haproxy_build_backends(struct haproxy *h, const char *vsb_data)
 			break;
 
 		*q++ = '\0';
-		sock = VTCP_listen_on("localhost:0", NULL, 100, &err);
+		sock = VTCP_listen_on("127.0.0.1:0", NULL, 100, &err);
 		if (err != NULL)
 			vtc_fatal(h->vl,
 			    "Create listen socket failed: %s", err);


More information about the varnish-commit mailing list