]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
Allow setting/getting socket option IPV6_V6ONLY for stream sockets
authorIvan Delamer <delamer@inicotech.com>
Tue, 3 Jul 2012 20:39:25 +0000 (14:39 -0600)
committerIvan Delamer <delamer@inicotech.com>
Tue, 3 Jul 2012 20:39:25 +0000 (14:39 -0600)
only, as datagram sockets do not support dual IP versions yet.

Change-Id: I2d89bdaa06b19dc0c553c7be6ac6e9a71d3ce8a5

src/api/sockets.c

index 8a05aed6c96e746159bd0217c4b9cad865d9fe30..6603671296c9c607a32cec0169d4c6d87323fca6 100644 (file)
@@ -1673,6 +1673,9 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen)
       if (*optlen < sizeof(int)) {
         err = EINVAL;
       }
+      /* @todo: this does not work for datagram sockets, yet */
+      if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP)
+        return 0;
       break;
     default:
       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)) {
         err = EINVAL;
       }
+
+      /* @todo: this does not work for datagram sockets, yet */
+      if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP)
+        return 0;
+
       break;
       default:
         LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_IPV6, UNIMPL: optname=0x%x, ..)\n",