From 2ff901e7bebdb937cb946924901a3eea37e7fa51 Mon Sep 17 00:00:00 2001 From: rwatson Date: Mon, 3 Apr 2006 09:52:55 +0000 Subject: After checking for SO_ISDISCONNECTED in tcp_usr_accept(), return immediately rather than jumping to the normal output handling, which assumes we've pulled out the inpcb, which hasn't happened at this point (and isn't necessary). Return ECONNABORTED instead of EINVAL when the inpcb has entered INP_TIMEWAIT or INP_DROPPED, as this is the documented error value. This may correct the panic seen by Ganbold. MFC after: 1 month Reported by: Ganbold --- sys/netinet/tcp_usrreq.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sys/netinet') diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index daec08e..b0ed728 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -590,16 +590,14 @@ tcp_usr_accept(struct socket *so, struct sockaddr **nam) in_port_t port = 0; TCPDEBUG0; - if (so->so_state & SS_ISDISCONNECTED) { - error = ECONNABORTED; - goto out; - } + if (so->so_state & SS_ISDISCONNECTED) + return (ECONNABORTED); inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_accept: inp == NULL")); INP_LOCK(inp); if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { - error = EINVAL; + error = ECONNABORTED; goto out; } tp = intotcpcb(inp); -- cgit v1.1