diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c
index a174f902e2ce76ccb31efe1ff246b3307dc4eaf3..cf6cc499fc5cf86d8ed6e78f814435aeb9d6c507 100644
--- a/tests/server/sockfilt.c
+++ b/tests/server/sockfilt.c
@@ -582,7 +582,7 @@ int main(int argc, char *argv[])
       memset(&me6, 0, sizeof(me6));
       me6.sin6_family = AF_INET6;
       me6.sin6_port = htons(connectport);
-      Curl_inet_pton(AF_INET, "::1", &me6.sin6_addr);
+      Curl_inet_pton(AF_INET6, "::1", &me6.sin6_addr);
 
       rc = connect(sock, (struct sockaddr *) &me6, sizeof(me6));
     }