Skip to content

Commit e08afec

Browse files
kusmagitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d5b6629 commit e08afec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

connect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static int git_tcp_connect_sock(char *host, int flags)
216216
if (flags & CONNECT_VERBOSE)
217217
fprintf(stderr, "done.\nConnecting to %s (port %s) ... ", host, port);
218218

219-
for (ai0 = ai; ai; ai = ai->ai_next) {
219+
for (ai0 = ai; ai; ai = ai->ai_next, cnt++) {
220220
sockfd = socket(ai->ai_family,
221221
ai->ai_socktype, ai->ai_protocol);
222222
if (sockfd < 0) {

0 commit comments

Comments
 (0)