diff --git a/CHANGELOG b/CHANGELOG index 7f0a945b..32659dd0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -233,6 +233,10 @@ HISTORY ++ Bugfixes: + 2010-11-20: Simon Goldschmidt + * sockets.c: Fixed bug #31590: getsockopt(... SO_ERROR ...) gives EINPROGRESS + after a successful nonblocking connection. + 2010-11-20: Simon Goldschmidt * etharp.c: Fixed bug #31722: IP packets sent with an AutoIP source addr must be sent link-local diff --git a/src/api/sockets.c b/src/api/sockets.c index 8cecb21e..a05f0aab 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -1701,8 +1701,8 @@ lwip_getsockopt_internal(void *arg) break; case SO_ERROR: - /* only overwrite if ERR_OK before */ - if (sock->err == 0) { + /* only overwrite ERR_OK or tempoary errors */ + if ((sock->err == 0) || (sock->err == EINPROGRESS)) { sock_set_errno(sock, err_to_errno(sock->conn->last_err)); } *(int *)optval = sock->err;