* [PATCH] daemon: remove unnecesary restriction for listener fd
@ 2025-06-26 9:51 Carlo Marcelo Arenas Belón
2025-06-26 13:17 ` Phillip Wood
0 siblings, 1 reply; 2+ messages in thread
From: Carlo Marcelo Arenas Belón @ 2025-06-26 9:51 UTC (permalink / raw)
To: git; +Cc: H . Peter Anvin, YOSHIFUJI Hideaki,
Carlo Marcelo Arenas Belón
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] daemon: remove unnecesary restriction for listener fd
2025-06-26 9:51 [PATCH] daemon: remove unnecesary restriction for listener fd Carlo Marcelo Arenas Belón
@ 2025-06-26 13:17 ` Phillip Wood
0 siblings, 0 replies; 2+ messages in thread
From: Phillip Wood @ 2025-06-26 13:17 UTC (permalink / raw)
To: Carlo Marcelo Arenas Belón, git; +Cc: H . Peter Anvin, YOSHIFUJI Hideaki
Hi Carlo
On 26/06/2025 10:51, Carlo Marcelo Arenas Belón wrote:
> 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.
Nice find, this patch looks good to me.
Thanks
Phillip
> 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) {
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-26 13:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-26 9:51 [PATCH] daemon: remove unnecesary restriction for listener fd Carlo Marcelo Arenas Belón
2025-06-26 13:17 ` Phillip Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox