summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorMark Lipscombe <mlipscombe@gmail.com>2015-02-24 12:28:27 -0800
committerRaghavendra G <rgowdapp@redhat.com>2015-02-26 09:12:09 -0800
commit0e3fd04e93b163f27ecbea4a3a777c041b4352b4 (patch)
tree305cdf4a32ca1f20bcacab6295530a89de68df4e /rpc
parentd1397dbd7d6cdbd2d81d5d36d608b6175d449db4 (diff)
rdma: Fix failure to call rdma_bind_addr if unable to bind privileged port.
When unable to bind a privileged port, rdma_bind_addr is not called. This patch fixes that. Change-Id: I175884a5d6a08b93dc62653ee0a6622bfc06e618 Bug: 1195907 Signed-off-by: Mark Lipscombe <mlipscombe@gmail.com> Reviewed-on: http://review.gluster.org/9737 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: mohammed rafi kc <rkavunga@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'rpc')
-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;