[master] c261c33 Make this work with ipv6 as well

Federico G. Schwindt fgsch at lodoss.net
Sun Jan 15 14:11:05 CET 2017


commit c261c331483003100e7437d7213e141423fab612
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Sun Jan 15 12:51:34 2017 +0000

    Make this work with ipv6 as well

diff --git a/lib/libvmod_debug/vmod_debug_dyn.c b/lib/libvmod_debug/vmod_debug_dyn.c
index 826595d..8f71121 100644
--- a/lib/libvmod_debug/vmod_debug_dyn.c
+++ b/lib/libvmod_debug/vmod_debug_dyn.c
@@ -58,19 +58,21 @@ dyn_dir_init(VRT_CTX, struct vmod_debug_dyn *dyn,
 	struct director *dir, *dir2;
 	struct vrt_backend vrt;
 
+	vrt.port = port;
+	vrt.hosthdr = addr;
 	CHECK_OBJ_NOTNULL(dyn, VMOD_DEBUG_DYN_MAGIC);
 	XXXAN(addr);
 	XXXAN(port);
 
 	INIT_OBJ(&vrt, VRT_BACKEND_MAGIC);
-	vrt.port = port;
 	vrt.vcl_name = dyn->vcl_name;
-	vrt.hosthdr = vrt.ipv4_addr;
+	vrt.port = port;
+	vrt.hosthdr = addr;
 
 	memset(&hints, 0, sizeof(hints));
-	hints.ai_family = AF_INET;
+	hints.ai_family = AF_UNSPEC;
 	hints.ai_socktype = SOCK_STREAM;
-	AZ(getaddrinfo(vrt.ipv4_addr, vrt.port, &hints, &res));
+	AZ(getaddrinfo(addr, port, &hints, &res));
 	XXXAZ(res->ai_next);
 
 	sa = VSA_Malloc(res->ai_addr, res->ai_addrlen);



More information about the varnish-commit mailing list