summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/rpc-transport')
-rw-r--r--rpc/rpc-transport/rdma/src/name.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/rpc/rpc-transport/rdma/src/name.c b/rpc/rpc-transport/rdma/src/name.c
index c57428ad62e..52ce5bbce55 100644
--- a/rpc/rpc-transport/rdma/src/name.c
+++ b/rpc/rpc-transport/rdma/src/name.c
@@ -437,7 +437,14 @@ gf_rdma_client_bind (rpc_transport_t *this, struct sockaddr *sockaddr,
"cannot bind rdma_cm_id to port "
"less than %d (%s)", GF_CLIENT_PORT_CEILING,
strerror (errno));
- ret = 0;
+ if (sockaddr->sa_family == AF_INET6) {
+ ((struct sockaddr_in6 *)sockaddr)->sin6_port
+ = htons (0);
+ } else {
+ ((struct sockaddr_in *)sockaddr)->sin_port
+ = htons (0);
+ }
+ ret = rdma_bind_addr (cm_id, sockaddr);
}
break;