mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 14:29:39 +00:00
fixed bug #33956 Wrong error returned when calling accept() on UDP connections
This commit is contained in:
parent
2e69b54a4f
commit
f64808c385
@ -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
|
||||
|
||||
|
@ -1095,6 +1095,8 @@ do_listen(struct api_msg_msg *msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
msg->err = ERR_ARG;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user