Fix that the socket option IPV6ONLY can only be set on TCP sockets

Reported by Andrej Butok
This commit is contained in:
Dirk Ziegelmeier 2017-08-10 09:14:31 +02:00
parent 3d82155d29
commit 0cf405e24f

View File

@ -3143,7 +3143,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
case IPPROTO_IPV6: case IPPROTO_IPV6:
switch (optname) { switch (optname) {
case IPV6_V6ONLY: case IPV6_V6ONLY:
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, int, NETCONN_TCP); LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, optlen, int);
if (*(const int*)optval) { if (*(const int*)optval) {
netconn_set_ipv6only(sock->conn, 1); netconn_set_ipv6only(sock->conn, 1);
} else { } else {