summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2007-11-16 19:24:07 +0000
committerderaadt <deraadt@openbsd.org>2007-11-16 19:24:07 +0000
commita34bdae23339465868925d3e8a27881a3600f903 (patch)
tree9e921acadf518d36fb72671ef7b800aa6632e1cf /sys/netinet/tcp_usrreq.c
parenttypo (diff)
downloadwireguard-openbsd-a34bdae23339465868925d3e8a27881a3600f903.tar.xz
wireguard-openbsd-a34bdae23339465868925d3e8a27881a3600f903.zip
in the strange/unnatural/ridiculous situation where a non-blocking
connect() which has completed and failed.. if connect() is called again.. return the so_error instead of EINVAL; from Alexey Vatchenko matches what other systems do now ok millert henning
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 8ccbf810f24..749f82406e6 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.92 2007/09/01 18:49:28 henning Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.93 2007/11/16 19:24:07 deraadt Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -182,6 +182,9 @@ tcp_usrreq(so, req, m, nam, control)
* structure will point at a subsidiary (struct tcpcb).
*/
if (inp == 0 && req != PRU_ATTACH) {
+ error = so->so_error;
+ if (error == 0)
+ error = EINVAL;
splx(s);
/*
* The following corrects an mbuf leak under rare
@@ -189,7 +192,7 @@ tcp_usrreq(so, req, m, nam, control)
*/
if (m && (req == PRU_SEND || req == PRU_SENDOOB))
m_freem(m);
- return (EINVAL); /* XXX */
+ return (error);
}
if (inp) {
tp = intotcpcb(inp);