File descriptors 0 to 2 may be network sockets, don’t rule them out.

This commit is contained in:
Sam Hocevar
2010-01-08 00:48:12 +00:00
committed by sam
parent 0d86e64a19
commit d21bc2cedc

View File

@@ -204,10 +204,6 @@ static unsigned int get_socket_ip(int sock)
socklen_t len = sizeof(sin);
int ret;
// Probably not a socket descriptor
if (sock < 3)
return 0;
/* Use a sockaddr instead of sockaddr_in because we don't know whether
* their alignments are compatible. So, no cast. */
memset(&s, 0, sizeof(sin));