Message ID | 0a6a8d14f8b06bab2682dd4e555c315d@imap.linux.ibm.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
diff --git a/src/rsocket.c b/src/rsocket.c index 16792cf..ae72a00 100644 --- a/src/rsocket.c +++ b/src/rsocket.c @@ -1179,9 +1179,15 @@ int rlisten(int socket, int backlog) rs = idm_lookup(&idm, socket); if (!rs) return ERR(EBADF); - ret = rdma_listen(rs->cm_id, backlog); - if (!ret) - rs->state = rs_listening; + + if (rs->state != rs_listening) { + ret = rdma_listen(rs->cm_id, backlog); + if (!ret) + rs->state = rs_listening; + } else { + ret = 0; + } + return ret; }