summaryrefslogtreecommitdiff
path: root/components/net/sal_socket/impl
diff options
context:
space:
mode:
authorHubretXie <[email protected]>2019-08-16 21:28:29 +0800
committerGitHub <[email protected]>2019-08-16 21:28:29 +0800
commit9662e18c3688681cd95ebd65242773dbe7c1366b (patch)
treeeb5b5326efc603b359d8758ee6cd17eebfb1fa75 /components/net/sal_socket/impl
parent56a65431dc830d6234a8a3286fea35664a65aeb1 (diff)
parent3b252d5b9721bb7cc649dad832507937efc1e96c (diff)
Merge pull request #7 from RT-Thread/master
sync
Diffstat (limited to 'components/net/sal_socket/impl')
-rw-r--r--components/net/sal_socket/impl/af_inet_lwip.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/components/net/sal_socket/impl/af_inet_lwip.c b/components/net/sal_socket/impl/af_inet_lwip.c
index 95e7633635..56df735ab9 100644
--- a/components/net/sal_socket/impl/af_inet_lwip.c
+++ b/components/net/sal_socket/impl/af_inet_lwip.c
@@ -25,6 +25,12 @@
#include <netdev.h>
+#if (LWIP_VERSION < 0x2000000) && NETDEV_IPV6
+#error "The lwIP version is not support IPV6, please disable netdev IPV6 configuration "
+#elif (LWIP_VERSION > 0x2000000) && (NETDEV_IPV6 != LWIP_IPV6)
+#error "IPV6 configuration error, Please check and synchronize netdev and lwip IPV6 configuration."
+#endif
+
#if LWIP_VERSION < 0x2000000
#define SELWAIT_T int
#else
@@ -267,6 +273,8 @@ static int inet_poll(struct dfs_fd *file, struct rt_pollreq *req)
if (sock->errevent)
{
mask |= POLLERR;
+ /* clean error event */
+ sock->errevent = 0;
}
rt_hw_interrupt_enable(level);
}
@@ -308,7 +316,11 @@ static const struct sal_netdb_ops lwip_netdb_ops =
static const struct sal_proto_family lwip_inet_family =
{
AF_INET,
+#if LWIP_VERSION > 0x2000000
+ AF_INET6,
+#else
AF_INET,
+#endif
&lwip_socket_ops,
&lwip_netdb_ops,
};