diff options
author | Paul Traina <pst@FreeBSD.org> | 1996-09-20 21:25:18 +0000 |
---|---|---|
committer | Paul Traina <pst@FreeBSD.org> | 1996-09-20 21:25:18 +0000 |
commit | 4195b4af58bf9be35eb607131f3d5592a47eb92a (patch) | |
tree | 11f85b992773b9cda81b9ca3502b35400e3e4a5f /sys/netinet/tcp_input.c | |
parent | 7dbead4e23e2b8a318d02bc2e418faba3b6a9b57 (diff) |
Notes
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 75a33e6e840e6..d861efee2ebf5 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 - * $Id: tcp_input.c,v 1.47 1996/09/13 18:47:03 pst Exp $ + * $Id: tcp_input.c,v 1.48 1996/09/13 23:51:41 pst Exp $ */ #ifndef TUBA_INCLUDE @@ -410,11 +410,24 @@ findpcb: #endif if (so->so_options & SO_ACCEPTCONN) { register struct tcpcb *tp0 = tp; - so = sonewconn(so, 0); - if (so == 0) { - tcpstat.tcps_listendrop++; - goto drop; + struct socket *so2; + /* + * If the attempt to get onto the socket queue failed, + * drop the oldest queue entry and try again. + */ + so2 = sonewconn(so, 0); + if (!so2) { + so2 = TAILQ_FIRST(&so->so_incom); + if (so2) { + tcp_drop(sototcpcb(so2), ETIMEDOUT); + so2 = sonewconn(so, 0); + } + if (!so2) { + tcpstat.tcps_listendrop++; + goto drop; + } } + so = so2; /* * This is ugly, but .... * |