git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] connect: correctly number ipv6 network adapter

From
Erik Faye-Lund <kusmabite@gmail.com>
Date
Aug 1, 2011, 11:16 UTC
Message-ID
<1312197370-5112-1-git-send-email-kusmabite@gmail.com>

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 <kusmabite@gmail.com>
---
 connect.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/connect.c b/connect.c
index 844107e..d2ce57f 100644
--- a/connect.c
+++ b/connect.c
@@ -217,7 +217,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) ||
-- 
1.7.6.347.g4db0d
Next: Erik Faye-Lund
Message 1 of 2 in “connect: correctly number ipv6 network adapter”
  1. 1/2 connect: correctly number ipv6 network adapterErik Faye-Lund, Aug 1, 2011
  2. 2/2 connect: only log if all attempts failed (ipv4)Erik Faye-Lund, Aug 1, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.