Fixed bug #31590: getsockopt(... SO_ERROR ...) gives EINPROGRESS after a successful nonblocking connection.

This commit is contained in:
goldsimon 2010-11-22 20:55:57 +00:00
parent f7627929d5
commit 377628216e
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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;