diff -urN linux/drivers/scsi/hosts.c linux-2.3.16-work/drivers/scsi/hosts.c --- linux/drivers/scsi/hosts.c Mon Aug 30 18:43:25 1999 +++ linux-2.3.16-work/drivers/scsi/hosts.c Mon Sep 6 12:34:51 1999 @@ -758,11 +758,11 @@ * Why is this a separate function? Because the kernel_thread code * effectively does a fork, and there is a builtin exit() call when * the child returns. The difficulty is that scsi_init() is - * marked __initfunc(), which means the memory is unmapped after bootup + * marked __init, which means the memory is unmapped after bootup * is complete, which means that the thread's exit() call gets wiped. * * The lesson is to *NEVER*, *NEVER* call kernel_thread() from an - * __initfunc() function, if that function could ever return. + * __init function, if that function could ever return. */ static void launch_error_handler_thread(struct Scsi_Host * shpnt) { diff -urN linux/net/appletalk/ddp.c linux-2.3.16-work/net/appletalk/ddp.c --- linux/net/appletalk/ddp.c Wed Aug 25 22:45:50 1999 +++ linux-2.3.16-work/net/appletalk/ddp.c Mon Sep 6 13:00:48 1999 @@ -1360,13 +1360,6 @@ return (0); } -/* - * Not relevant - */ -static int atalk_accept(struct socket *sock, struct socket *newsock, int flags) -{ - return (-EOPNOTSUPP); -} /* * Find the name of an AppleTalk socket. Just copy the right @@ -1918,10 +1911,6 @@ return (err ? err : (copied)); } -static int atalk_shutdown(struct socket *sk,int how) -{ - return (-EOPNOTSUPP); -} /* * AppleTalk ioctl calls. @@ -2029,12 +2018,12 @@ atalk_bind, atalk_connect, sock_no_socketpair, - atalk_accept, + sock_no_accept, atalk_getname, datagram_poll, atalk_ioctl, sock_no_listen, - atalk_shutdown, + sock_no_shutdown, sock_no_setsockopt, sock_no_getsockopt, sock_no_fcntl, diff -urN linux/net/atm/pvc.c linux-2.3.16-work/net/atm/pvc.c --- linux/net/atm/pvc.c Thu Aug 26 22:13:59 1999 +++ linux-2.3.16-work/net/atm/pvc.c Mon Sep 6 12:43:46 1999 @@ -62,18 +62,6 @@ } -static int pvc_listen(struct socket *sock,int backlog) -{ - return -EOPNOTSUPP; -} - - -static int pvc_accept(struct socket *sock,struct socket *newsock,int flags) -{ - return -EOPNOTSUPP; -} - - static int pvc_getname(struct socket *sock,struct sockaddr *sockaddr, int *sockaddr_len,int peer) { @@ -100,11 +88,11 @@ pvc_bind, pvc_connect, sock_no_socketpair, - pvc_accept, + sock_no_accept, pvc_getname, atm_poll, atm_ioctl, - pvc_listen, + sock_no_listen, pvc_shutdown, atm_setsockopt, atm_getsockopt, diff -urN linux/net/decnet/af_decnet.c linux-2.3.16-work/net/decnet/af_decnet.c --- linux/net/decnet/af_decnet.c Tue Aug 31 19:23:03 1999 +++ linux-2.3.16-work/net/decnet/af_decnet.c Mon Sep 6 13:02:51 1999 @@ -1239,9 +1239,6 @@ if ((sk->protinfo.dn.state != DN_O) || (sk->state == TCP_LISTEN)) goto out; - if (backlog > SOMAXCONN) - backlog = SOMAXCONN; - sk->max_ack_backlog = backlog; sk->ack_backlog = 0; sk->state = TCP_LISTEN; diff -urN linux/net/ipv4/af_inet.c linux-2.3.16-work/net/ipv4/af_inet.c --- linux/net/ipv4/af_inet.c Tue Aug 31 19:30:48 1999 +++ linux-2.3.16-work/net/ipv4/af_inet.c Mon Sep 6 13:00:01 1999 @@ -285,11 +285,6 @@ if (sock->state != SS_UNCONNECTED || sock->type != SOCK_STREAM) return -EINVAL; - if ((unsigned) backlog == 0) /* BSDism */ - backlog = 1; - if ((unsigned) backlog > SOMAXCONN) - backlog = SOMAXCONN; - lock_sock(sk); old_state = sk->state; err = -EINVAL; diff -urN linux/net/ipx/af_ipx.c linux-2.3.16-work/net/ipx/af_ipx.c --- linux/net/ipx/af_ipx.c Mon Aug 30 18:31:24 1999 +++ linux-2.3.16-work/net/ipx/af_ipx.c Mon Sep 6 12:55:17 1999 @@ -1983,10 +1983,6 @@ return (0); } -static int ipx_accept(struct socket *sock, struct socket *newsock, int flags) -{ - return (-EOPNOTSUPP); -} static int ipx_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer) @@ -2213,13 +2209,6 @@ return (err); } -/* - * FIXME: We have to really support shutdown. - */ -static int ipx_shutdown(struct socket *sk,int how) -{ - return (-EOPNOTSUPP); -} static int ipx_ioctl(struct socket *sock,unsigned int cmd, unsigned long arg) { @@ -2342,12 +2331,12 @@ ipx_bind, ipx_connect, sock_no_socketpair, - ipx_accept, + sock_no_accept, ipx_getname, datagram_poll, ipx_ioctl, sock_no_listen, - ipx_shutdown, + sock_no_shutdown, /* FIXME: We have to really support shutdown. */ ipx_setsockopt, ipx_getsockopt, sock_no_fcntl, diff -urN linux/net/ipx/af_spx.c linux-2.3.16-work/net/ipx/af_spx.c --- linux/net/ipx/af_spx.c Mon Aug 23 18:01:02 1999 +++ linux-2.3.16-work/net/ipx/af_spx.c Mon Sep 6 13:05:03 1999 @@ -113,10 +113,6 @@ return (0); } -static int spx_shutdown(struct socket *sk,int how) -{ - return (-EOPNOTSUPP); -} void spx_close_socket(struct sock *sk) { @@ -184,10 +180,6 @@ if(sk->zapped != 0) return (-EAGAIN); - if((unsigned) backlog == 0) /* BSDism */ - backlog = 1; - if((unsigned) backlog > SOMAXCONN) - backlog = SOMAXCONN; sk->max_ack_backlog = backlog; if(sk->state != TCP_LISTEN) { @@ -853,7 +845,7 @@ datagram_poll, /* this does seqpacket too */ spx_ioctl, spx_listen, - spx_shutdown, + sock_no_shutdown, spx_setsockopt, spx_getsockopt, sock_no_fcntl, diff -urN linux/net/netrom/af_netrom.c linux-2.3.16-work/net/netrom/af_netrom.c --- linux/net/netrom/af_netrom.c Thu Aug 26 22:13:59 1999 +++ linux-2.3.16-work/net/netrom/af_netrom.c Mon Sep 6 13:06:57 1999 @@ -1100,10 +1100,6 @@ return copied; } -static int nr_shutdown(struct socket *sk, int how) -{ - return -EOPNOTSUPP; -} static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { @@ -1255,7 +1251,7 @@ datagram_poll, nr_ioctl, nr_listen, - nr_shutdown, + sock_no_shutdown, nr_setsockopt, nr_getsockopt, sock_no_fcntl, diff -urN linux/net/rose/af_rose.c linux-2.3.16-work/net/rose/af_rose.c --- linux/net/rose/af_rose.c Thu Aug 26 22:13:59 1999 +++ linux-2.3.16-work/net/rose/af_rose.c Mon Sep 6 12:47:05 1999 @@ -1245,10 +1245,6 @@ return copied; } -static int rose_shutdown(struct socket *sk, int how) -{ - return -EOPNOTSUPP; -} static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { @@ -1445,7 +1441,7 @@ datagram_poll, rose_ioctl, rose_listen, - rose_shutdown, + sock_no_shutdown, rose_setsockopt, rose_getsockopt, sock_no_fcntl, diff -urN linux/net/socket.c linux-2.3.16-work/net/socket.c --- linux/net/socket.c Mon Aug 23 19:15:53 1999 +++ linux-2.3.16-work/net/socket.c Mon Sep 6 12:58:32 1999 @@ -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); } diff -urN linux/net/unix/af_unix.c linux-2.3.16-work/net/unix/af_unix.c --- linux/net/unix/af_unix.c Tue Aug 31 19:30:48 1999 +++ linux-2.3.16-work/net/unix/af_unix.c Mon Sep 6 12:59:47 1999 @@ -414,8 +414,6 @@ err = -EINVAL; if (!sk->protinfo.af_unix.addr) goto out; /* No listens on an unbound socket */ - if ((unsigned) backlog > SOMAXCONN) - backlog = SOMAXCONN; unix_state_wlock(sk); if (sk->state != TCP_CLOSE && sk->state != TCP_LISTEN) goto out_unlock; diff -urN linux/net/x25/af_x25.c linux-2.3.16-work/net/x25/af_x25.c --- linux/net/x25/af_x25.c Mon Aug 30 18:31:24 1999 +++ linux-2.3.16-work/net/x25/af_x25.c Mon Sep 6 12:48:27 1999 @@ -1044,10 +1044,6 @@ return copied; } -static int x25_shutdown(struct socket *sk, int how) -{ - return -EOPNOTSUPP; -} static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { @@ -1246,7 +1242,7 @@ datagram_poll, x25_ioctl, x25_listen, - x25_shutdown, + sock_no_shutdown, x25_setsockopt, x25_getsockopt, sock_no_fcntl, .