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 <sgarzare@redhat.com> Reviewed-by: Luigi Leonardi <leonardi@redhat.com> Signed-off-by: Michal Luczaj <mhal@rbox.co> Link: https://patch.msgid.link/20250128-vsock-transport-vs-autobind-v3-2-1cf57065b770@rbox.co Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent fcdd224 commit aa388c7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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)