mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-06 22:44:38 +08:00
Allow setting/getting socket option IPV6_V6ONLY for stream sockets
only, as datagram sockets do not support dual IP versions yet. Change-Id: I2d89bdaa06b19dc0c553c7be6ac6e9a71d3ce8a5
This commit is contained in:
parent
e65202f825
commit
6c12e5bfbe
@ -1673,6 +1673,9 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen)
|
|||||||
if (*optlen < sizeof(int)) {
|
if (*optlen < sizeof(int)) {
|
||||||
err = EINVAL;
|
err = EINVAL;
|
||||||
}
|
}
|
||||||
|
/* @todo: this does not work for datagram sockets, yet */
|
||||||
|
if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP)
|
||||||
|
return 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IPV6, UNIMPL: optname=0x%x, ..)\n",
|
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IPV6, UNIMPL: optname=0x%x, ..)\n",
|
||||||
@ -2125,6 +2128,11 @@ lwip_setsockopt(int s, int level, int optname, const void *optval, socklen_t opt
|
|||||||
if (optlen < sizeof(int)) {
|
if (optlen < sizeof(int)) {
|
||||||
err = EINVAL;
|
err = EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* @todo: this does not work for datagram sockets, yet */
|
||||||
|
if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP)
|
||||||
|
return 0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_IPV6, UNIMPL: optname=0x%x, ..)\n",
|
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_IPV6, UNIMPL: optname=0x%x, ..)\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user