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

[PATCH] daemon: remove unnecesary restriction for listener fd

From
Carlo Marcelo Arenas Belón <carenas@gmail.com>
Date
Jun 26, 2025, 09:51 UTC
Message-ID
<20250626095139.70751-1-carenas@gmail.com>

Since df076bdbcc ([PATCH] GIT: Listen on IPv6 as well, if available., 2005-07-23), any file descriptor assigned to a listening socket was validated to be within the range to be used in an FDSET later.

6573faff34 (NO_IPV6 support for git daemon, 2005-09-28), moves to use poll() instead of select(), that doesn't have that restriction, so remove the original check.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 daemon.c | 5 -----
 1 file changed, 5 deletions(-)
diff --git a/daemon.c b/daemon.c
index d1be61fd57..99741f0b45 100644
--- a/daemon.c
+++ b/daemon.c
@@ -990,11 +990,6 @@ static int setup_named_sock(char *listen_addr, int listen_port, struct socketlis
 		sockfd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
 		if (sockfd < 0)
 			continue;
-		if (sockfd >= FD_SETSIZE) {
-			logerror("Socket descriptor too large");
-			close(sockfd);
-			continue;
-		}
 
 #ifdef IPV6_V6ONLY
 		if (ai->ai_family == AF_INET6) {
-- 
2.50.0.132.g8e5a977e07
Next: Phillip Wood
Message 1 of 2 in “daemon: remove unnecesary restriction for listener fd”
  1. daemon: remove unnecesary restriction for listener fdCarlo Marcelo Arenas Belón, Jun 26, 2025
  2. Phillip WoodJun 26, 2025

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.