Skip to content

Commit dd4fc67

Browse files
committed
librdmacm: Run connect service with TCP protocol
To allow us to respond to disconnect events initiated by the peer kernel CM, run the connect service always with TCP protocol- also when connection succeeds. Signed-off-by: Batsheva Black <bblack@nvidia.com>
1 parent 0271001 commit dd4fc67

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

librdmacm/rsocket.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,12 +1774,11 @@ int rconnect(int socket, const struct sockaddr *addr, socklen_t addrlen)
17741774
if (rs->type == SOCK_STREAM) {
17751775
memcpy(&rs->cm_id->route.addr.dst_addr, addr, addrlen);
17761776
ret = rs_do_connect(rs);
1777-
if (ret == -1 && errno == EINPROGRESS) {
1778-
save_errno = errno;
1779-
/* The app can still drive the CM state on failure */
1780-
rs_notify_svc(&connect_svc, rs, RS_SVC_ADD_CM);
1781-
errno = save_errno;
1782-
}
1777+
save_errno = errno;
1778+
/* The app can still drive the CM state on failure,
1779+
* and can respond to disconnect requests */
1780+
rs_notify_svc(&connect_svc, rs, RS_SVC_ADD_CM);
1781+
errno = save_errno;
17831782
} else {
17841783
if (rs->state == rs_init) {
17851784
ret = ds_init_ep(rs);

0 commit comments

Comments
 (0)