mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-26 21:14:09 +00:00
fixed get_socket, fixed LWIP_SOCKET_OFFSET != 0
This commit is contained in:
parent
8bb43e7388
commit
f4d13d52d3
@ -424,7 +424,7 @@ tryget_socket(int fd)
|
||||
static struct lwip_sock *
|
||||
get_socket(int fd)
|
||||
{
|
||||
struct lwip_sock *sock = tryget_socket_unconn(fd);
|
||||
struct lwip_sock *sock = tryget_socket(fd);
|
||||
if (!sock) {
|
||||
if ((fd < LWIP_SOCKET_OFFSET) || (fd >= (LWIP_SOCKET_OFFSET + NUM_SOCKETS))) {
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("get_socket(%d): invalid\n", fd));
|
||||
@ -1353,7 +1353,7 @@ lwip_socket(int domain, int type, int protocol)
|
||||
return -1;
|
||||
}
|
||||
conn->socket = i;
|
||||
done_socket(&sockets[i]);
|
||||
done_socket(&sockets[i - LWIP_SOCKET_OFFSET]);
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("%d\n", i));
|
||||
set_errno(0);
|
||||
return i;
|
||||
|
Loading…
Reference in New Issue
Block a user