Skip to content

Commit

Permalink
connect: correctly number ipv6 network adapter
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
kusma authored and gitster committed Aug 1, 2011
1 parent d5b6629 commit e08afec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e08afec

Please sign in to comment.