summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/ucma.c
diff options
context:
space:
mode:
authorSean Hefty <sean.hefty@intel.com>2012-06-14 20:31:39 +0000
committerRoland Dreier <roland@purestorage.com>2012-07-08 18:02:24 -0700
commit68602120e496a31d8e3b36d0bfc7d9d2456fb05c (patch)
tree04eea1c0673ff60d1e9881b1d73785c0ed6f8271 /drivers/infiniband/core/ucma.c
parent406b6a25f85271397739a7e9f5af1df665b8a0d0 (diff)
downloadblackbird-op-linux-68602120e496a31d8e3b36d0bfc7d9d2456fb05c.tar.gz
blackbird-op-linux-68602120e496a31d8e3b36d0bfc7d9d2456fb05c.zip
RDMA/cma: Allow user to restrict listens to bound address family
Provide an option for the user to specify that listens should only accept connections where the incoming address family matches that of the locally bound address. This is used to support the equivalent of IPV6_V6ONLY socket option, which allows an app to only accept connection requests directed to IPv6 addresses. Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/core/ucma.c')
-rw-r--r--drivers/infiniband/core/ucma.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 8002ae642cfe..893cb879462c 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -909,6 +909,13 @@ static int ucma_set_option_id(struct ucma_context *ctx, int optname,
}
ret = rdma_set_reuseaddr(ctx->cm_id, *((int *) optval) ? 1 : 0);
break;
+ case RDMA_OPTION_ID_AFONLY:
+ if (optlen != sizeof(int)) {
+ ret = -EINVAL;
+ break;
+ }
+ ret = rdma_set_afonly(ctx->cm_id, *((int *) optval) ? 1 : 0);
+ break;
default:
ret = -ENOSYS;
}
OpenPOWER on IntegriCloud