summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2010-06-01 13:59:48 +0000
committerrwatson <rwatson@FreeBSD.org>2010-06-01 13:59:48 +0000
commitdac680de2dbde9e20cec20ada325699a0f030d04 (patch)
tree001658a49a7163b39b20b1d9f60f959160c0f696 /sys/kern
parenta221dbe3dceb194e30f87e3f96b5641816e77ff7 (diff)
downloadFreeBSD-src-dac680de2dbde9e20cec20ada325699a0f030d04.zip
FreeBSD-src-dac680de2dbde9e20cec20ada325699a0f030d04.tar.gz
Merge r208601 from head to stable/8:
When close() is called on a connected socket pair, SO_ISCONNECTED might be set but be cleared before the call to sodisconnect(). In this case, ENOTCONN is returned: suppress this error rather than returning it to userspace so that close() doesn't report an error improperly. PR: kern/144061 Reported by: Matt Reimer <mreimer at vpop.net>, Nikolay Denev <ndenev at gmail.com>, Mikolaj Golub <to.my.trociny at gmail.com> Approved by: re (kib)
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/uipc_socket.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 07f0e1b..1f64128 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -656,8 +656,11 @@ soclose(struct socket *so)
if (so->so_state & SS_ISCONNECTED) {
if ((so->so_state & SS_ISDISCONNECTING) == 0) {
error = sodisconnect(so);
- if (error)
+ if (error) {
+ if (error == ENOTCONN)
+ error = 0;
goto drop;
+ }
}
if (so->so_options & SO_LINGER) {
if ((so->so_state & SS_ISDISCONNECTING) &&
OpenPOWER on IntegriCloud