summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-transport/rdma/src/name.c4
-rw-r--r--rpc/rpc-transport/socket/src/name.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/rpc/rpc-transport/rdma/src/name.c b/rpc/rpc-transport/rdma/src/name.c
index 0bbbbc0bede..93b249855e1 100644
--- a/rpc/rpc-transport/rdma/src/name.c
+++ b/rpc/rpc-transport/rdma/src/name.c
@@ -67,12 +67,14 @@ af_inet_bind_to_port_lt_ceiling (struct rdma_cm_id *cm_id,
}
while (port) {
- _assign_port (sockaddr, port);
/* ignore the reserved ports */
if (ports[port] == _gf_true) {
port--;
continue;
}
+
+ _assign_port (sockaddr, port);
+
ret = rdma_bind_addr (cm_id, sockaddr);
if (ret == 0)
diff --git a/rpc/rpc-transport/socket/src/name.c b/rpc/rpc-transport/socket/src/name.c
index a8cf04d8ab7..725a8c18120 100644
--- a/rpc/rpc-transport/socket/src/name.c
+++ b/rpc/rpc-transport/socket/src/name.c
@@ -56,12 +56,14 @@ af_inet_bind_to_port_lt_ceiling (int fd, struct sockaddr *sockaddr,
while (port)
{
- _assign_port (sockaddr, port);
// ignore the reserved ports
if (ports[port] == _gf_true) {
port--;
continue;
}
+
+ _assign_port (sockaddr, port);
+
ret = bind (fd, sockaddr, sockaddr_len);
if (ret == 0)