summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-04-03 09:52:55 +0000
committerrwatson <rwatson@FreeBSD.org>2006-04-03 09:52:55 +0000
commit2ff901e7bebdb937cb946924901a3eea37e7fa51 (patch)
tree17a24a4a682a67c245d153f9b7c0586fe817e55c
parentc8b4c281faf741755004c5c7a66d1793de1b9a26 (diff)
downloadFreeBSD-src-2ff901e7bebdb937cb946924901a3eea37e7fa51.zip
FreeBSD-src-2ff901e7bebdb937cb946924901a3eea37e7fa51.tar.gz
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 <ganbold at micom dot mng dot net>
-rw-r--r--sys/netinet/tcp_usrreq.c8
1 files changed, 3 insertions, 5 deletions
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);
OpenPOWER on IntegriCloud