From: Sean Hefty Date: Mon, 4 Jun 2012 19:50:48 +0000 (-0700) Subject: Refresh of ip6-opt X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=d46ef3377fbd61834997a6f1640db23e5d6c5434;p=~shefty%2Flibrdmacm.git Refresh of ip6-opt --- diff --git a/src/rsocket.c b/src/rsocket.c index c1117970..8b1e9307 100644 --- a/src/rsocket.c +++ b/src/rsocket.c @@ -156,6 +156,7 @@ struct rsocket { long fd_flags; uint64_t so_opts; uint64_t tcp_opts; + uint64_t ipv6_opts; enum rs_state state; int cq_armed; int retries; @@ -1717,6 +1718,17 @@ int rsetsockopt(int socket, int level, int optname, break; } break; + case IPPROTO_IPV6: + opts = &rs->ipv6_opts; + switch (optname) { + case IPV6_V6ONLY: + opt_on = *(int *) optval; + ret = 0; + break; + default: + break; + } + break; case SOL_RDMA: if (rs->state > rs_listening) { ret = ERR(EINVAL); @@ -1804,6 +1816,17 @@ int rgetsockopt(int socket, int level, int optname, break; } break; + case IPPROTO_IPV6: + switch (optname) { + case IPV6_V6ONLY: + *((int *) optval) = !!(rs->ipv6_opts & (1 << optname)); + *optlen = sizeof(int); + break; + default: + ret = ENOTSUP; + break; + } + break; case SOL_RDMA: switch (optname) { case RDMA_SQSIZE: