patch-2.3.17 linux/net/socket.c
Next file: linux/net/unix/af_unix.c
Previous file: linux/net/rose/af_rose.c
Back to the patch index
Back to the overall index
- Lines: 20
- Date:
Tue Sep 7 10:20:11 1999
- Orig file:
v2.3.16/linux/net/socket.c
- Orig date:
Thu Aug 26 13:05:46 1999
diff -u --recursive --new-file v2.3.16/linux/net/socket.c linux/net/socket.c
@@ -42,6 +42,8 @@
* Andi Kleen : Some small cleanups, optimizations,
* and fixed a copy_from_user() bug.
* Tigran Aivazian : sys_send(args) calls sys_sendto(args, NULL, 0)
+ * Tigran Aivazian : Made listen(2) backlog sanity checks
+ * protocol-independent
*
*
* This program is free software; you can redistribute it and/or
@@ -894,6 +896,10 @@
int err;
if ((sock = sockfd_lookup(fd, &err)) != NULL) {
+ if ((unsigned) backlog == 0) /* BSDism */
+ backlog = 1;
+ if ((unsigned) backlog > SOMAXCONN)
+ backlog = SOMAXCONN;
err=sock->ops->listen(sock, backlog);
sockfd_put(sock);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)