If the user specifies an AF_IB address into rdma_bind_addr,
rdma_resolve_addr, rdma_join_multicast, or rdma_leave_multicast,
but the kernel does not support AF_IB return an error.
Note that rdma_getaddrinfo will never return an AF_IB address to the
user unless kernel support is present. A application would need
to construct and AF_IB address by hand before making one of the
above mentioned calls. This check prevents overrunning the
command buffer written to the kernel.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
case PF_INET6:
return sizeof(struct sockaddr_in6);
case PF_IB:
- return sizeof(struct sockaddr_ib);
+ return af_ib_support ? sizeof(struct sockaddr_ib) : 0;
default:
return 0;
}