Skip to content

Commit aa388c7

Browse files
mmhalkuba-moo
authored andcommitted
vsock: Allow retrying on connect() failure
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]>
1 parent fcdd224 commit aa388c7

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
@@ -1523,6 +1523,11 @@ static int vsock_connect(struct socket *sock, struct sockaddr *addr,
15231523
if (err < 0)
15241524
goto out;
15251525

1526+
/* sk_err might have been set as a result of an earlier
1527+
* (failed) connect attempt.
1528+
*/
1529+
sk->sk_err = 0;
1530+
15261531
/* Mark sock as connecting and set the error code to in
15271532
* progress in case this is a non-blocking connect.
15281533
*/

0 commit comments

Comments
 (0)