From d4384cfac41c83e67179013b9d59f6ecb84bf03a Mon Sep 17 00:00:00 2001 From: Joel Cunningham Date: Mon, 31 Oct 2016 15:37:13 -0500 Subject: [PATCH] Sockets: check external FD_SETSIZE against number of sockets This commit adds a compiler check to verify an external FD_SETSIZE has enough space to store the configured number of sockets --- src/include/lwip/sockets.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/include/lwip/sockets.h b/src/include/lwip/sockets.h index 33d3cda2..9d76776f 100644 --- a/src/include/lwip/sockets.h +++ b/src/include/lwip/sockets.h @@ -428,6 +428,8 @@ typedef struct fd_set #elif LWIP_SOCKET_OFFSET #error LWIP_SOCKET_OFFSET does not work with external FD_SET! +#elif FD_SETSIZE < MEMP_NUM_NETCONN +#error "external FD_SETSIZE too small for number of sockets" #endif /* FD_SET */ /** LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided