Skip to content

Commit f2404d4

Browse files
mmhaljfvogel
authored andcommitted
vsock: Allow retrying on connect() failure
[ Upstream commit aa388c7 ] sk_err is set when a (connectible) connect() fails. Effectively, this makes an otherwise still healthy SS_UNCONNECTED socket impossible to use for any subsequent connection attempts. Clear sk_err upon trying to establish a connection. Fixes: d021c34 ("VSOCK: Introduce VM Sockets") Reviewed-by: Stefano Garzarella <[email protected]> Reviewed-by: Luigi Leonardi <[email protected]> Signed-off-by: Michal Luczaj <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit a06bb37d6541d545965ec7dddfe1b73dbb10e2ee) Signed-off-by: Jack Vogel <[email protected]>
1 parent 289ebee commit f2404d4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

net/vmw_vsock/af_vsock.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,6 +1519,11 @@ static int vsock_connect(struct socket *sock, struct sockaddr *addr,
15191519
if (err < 0)
15201520
goto out;
15211521

1522+
/* sk_err might have been set as a result of an earlier
1523+
* (failed) connect attempt.
1524+
*/
1525+
sk->sk_err = 0;
1526+
15221527
/* Mark sock as connecting and set the error code to in
15231528
* progress in case this is a non-blocking connect.
15241529
*/

0 commit comments

Comments
 (0)