mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-16 23:15:37 +00:00
fixed bug #33956 Wrong error returned when calling accept() on UDP connections
This commit is contained in:
parent
e2cdf0d39d
commit
422e7963de
@ -21,6 +21,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
|
||||
|
||||
|
@ -1089,6 +1089,8 @@ do_listen(struct api_msg_msg *msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
msg->err = ERR_ARG;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -336,6 +336,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;
|
||||
}
|
||||
@ -537,6 +541,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