daemon: remove unnecesary restriction for listener fd
PATCH 1/1 daemon: remove unnecesary restriction for listener fd
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.
--- daemon.c | 5 ----- 1 file changed, 5 deletions(-)
daemon.c +0 -5
@@ -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 ) {
Signature · 1 line
2.50.0.132.g8e5a977e07
Hi Carlo
Quoted 7 lines · 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_IPV6support for git daemon, 2005-09-28), moves to usepoll()instead ofselect(), that doesn't have that restriction, so remove the original check.
Nice find, this patch looks good to me.
Thanks
Phillip
Quoted 21 lines
Signed-off-by Carlo Marcelo Arenas Belón <[email protected]>--- daemon.c | 5 ----- 1 file changed, 5 deletions(-)daemon.c +0
-5@@ -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 ) {