Skip to content

Commit f6bdc42

Browse files
karstengrdavem330
authored andcommitted
net/smc: reset recv timeout after clc handshake
During clc handshake the receive timeout is set to CLC_WAIT_TIME. Remember and reset the original timeout value after the receive calls, and remove a duplicate assignment of CLC_WAIT_TIME. Signed-off-by: Karsten Graul <[email protected]> Signed-off-by: Ursula Braun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ac0107e commit f6bdc42

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/smc/smc_clc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ int smc_clc_prfx_match(struct socket *clcsock,
250250
int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
251251
u8 expected_type)
252252
{
253+
long rcvtimeo = smc->clcsock->sk->sk_rcvtimeo;
253254
struct sock *clc_sk = smc->clcsock->sk;
254255
struct smc_clc_msg_hdr *clcm = buf;
255256
struct msghdr msg = {NULL, 0};
@@ -306,7 +307,6 @@ int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
306307
memset(&msg, 0, sizeof(struct msghdr));
307308
iov_iter_kvec(&msg.msg_iter, READ | ITER_KVEC, &vec, 1, datlen);
308309
krflags = MSG_WAITALL;
309-
smc->clcsock->sk->sk_rcvtimeo = CLC_WAIT_TIME;
310310
len = sock_recvmsg(smc->clcsock, &msg, krflags);
311311
if (len < datlen || !smc_clc_msg_hdr_valid(clcm)) {
312312
smc->sk.sk_err = EPROTO;
@@ -322,6 +322,7 @@ int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
322322
}
323323

324324
out:
325+
smc->clcsock->sk->sk_rcvtimeo = rcvtimeo;
325326
return reason_code;
326327
}
327328

0 commit comments

Comments
 (0)