fixed bug #33956 Wrong error returned when calling accept() on UDP connections

This commit is contained in:
Simon Goldschmidt 2011-08-24 21:12:12 +02:00
parent 2e69b54a4f
commit f64808c385
3 changed files with 14 additions and 0 deletions

View File

@ -41,6 +41,10 @@ HISTORY
++ Bugfixes:
2011-08-24: Simon Goldschmidt
* api_msg.c, sockets.c: fixed bug #33956 Wrong error returned when calling
accept() on UDP connections
2011-08-24: Simon Goldschmidt
* sockets.h: fixed bug #34057 socklen_t should be a typedef

View File

@ -1095,6 +1095,8 @@ do_listen(struct api_msg_msg *msg)
}
}
}
} else {
msg->err = ERR_ARG;
}
}
}

View File

@ -407,6 +407,10 @@ lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
err = netconn_accept(sock->conn, &newconn);
if (err != ERR_OK) {
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d): netconn_acept failed, err=%d\n", s, err));
if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP) {
sock_set_errno(sock, EOPNOTSUPP);
return EOPNOTSUPP;
}
sock_set_errno(sock, err_to_errno(err));
return -1;
}
@ -611,6 +615,10 @@ lwip_listen(int s, int backlog)
if (err != ERR_OK) {
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_listen(%d) failed, err=%d\n", s, err));
if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP) {
sock_set_errno(sock, EOPNOTSUPP);
return EOPNOTSUPP;
}
sock_set_errno(sock, err_to_errno(err));
return -1;
}