mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
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: d021c34405 ("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>
This commit is contained in:
parent
fcdd2242c0
commit
aa388c7211
|
|
@ -1523,6 +1523,11 @@ static int vsock_connect(struct socket *sock, struct sockaddr *addr,
|
|||
if (err < 0)
|
||||
goto out;
|
||||
|
||||
/* sk_err might have been set as a result of an earlier
|
||||
* (failed) connect attempt.
|
||||
*/
|
||||
sk->sk_err = 0;
|
||||
|
||||
/* Mark sock as connecting and set the error code to in
|
||||
* progress in case this is a non-blocking connect.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user