diff options
-rw-r--r-- | rpc/rpc-transport/rdma/src/rdma.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c index 4837a17532e..4c01c14a927 100644 --- a/rpc/rpc-transport/rdma/src/rdma.c +++ b/rpc/rpc-transport/rdma/src/rdma.c @@ -4389,6 +4389,7 @@ gf_rdma_listen (rpc_transport_t *this) int ret = 0; gf_rdma_ctx_t *rdma_ctx = NULL; char service[NI_MAXSERV], host[NI_MAXHOST]; + int optval = 2; priv = this->private; peer = &priv->peer; @@ -4430,6 +4431,15 @@ gf_rdma_listen (rpc_transport_t *this) sprintf (this->myinfo.identifier, "%s:%s", host, service); + ret = rdma_set_option(peer->cm_id, RDMA_OPTION_ID, + RDMA_OPTION_ID_REUSEADDR, + (void *)&optval, sizeof(optval)); + if (ret != 0) { + gf_log (this->name, GF_LOG_WARNING, + "rdma option set failed (%s)", strerror (errno)); + goto err; + } + ret = rdma_bind_addr (peer->cm_id, &sock_union.sa); if (ret != 0) { gf_log (this->name, GF_LOG_WARNING, |