From e08afecd7fe04b519b72f136c4a24b151c748f49 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 1 Aug 2011 13:16:09 +0200 Subject: [PATCH] connect: correctly number ipv6 network adapter In ba50532, the variable 'cnt' was added to both the IPv6 and the IPv4 version of git_tcp_connect_sock, intended to identify which network adapter the connection failed on. But in the IPv6 version, the variable was never increased, leaving it constantly at zero. This behaviour isn't very useful, so let's fix it by increasing the variable at every loop-iteration. Signed-off-by: Erik Faye-Lund Signed-off-by: Junio C Hamano --- connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connect.c b/connect.c index 2119c3f74e..b3585aba22 100644 --- a/connect.c +++ b/connect.c @@ -216,7 +216,7 @@ static int git_tcp_connect_sock(char *host, int flags) if (flags & CONNECT_VERBOSE) fprintf(stderr, "done.\nConnecting to %s (port %s) ... ", host, port); - for (ai0 = ai; ai; ai = ai->ai_next) { + for (ai0 = ai; ai; ai = ai->ai_next, cnt++) { sockfd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); if (sockfd < 0) { -- 2.39.2