From 488a0fd360a54249305673c78f86bb6de815b468 Mon Sep 17 00:00:00 2001 From: armink Date: Sun, 27 May 2018 21:30:04 +0800 Subject: [PATCH] [fs][net] Add lwIP version check on setsockopt(). --- components/dfs/filesystems/net/net_sockets.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/dfs/filesystems/net/net_sockets.c b/components/dfs/filesystems/net/net_sockets.c index 4f33571129..d4b6ea9e31 100644 --- a/components/dfs/filesystems/net/net_sockets.c +++ b/components/dfs/filesystems/net/net_sockets.c @@ -223,6 +223,10 @@ int setsockopt(int s, int level, int optname, const void *optval, socklen_t optl { int sock = dfs_net_getsocket(s); +#if LWIP_VERSION_MAJOR < 2U +#error "Your lwIP version is not supported. Please using lwIP 2.0.0+." +#endif + return lwip_setsockopt(sock, level, optname, optval, optlen); } RTM_EXPORT(setsockopt); @@ -346,4 +350,3 @@ int ioctlsocket(int s, long cmd, void *arg) return lwip_ioctl(sock, cmd, arg); } RTM_EXPORT(ioctlsocket); -