mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 11:54:14 -04:00
vsock: Allow retrying on connect() failure
[ Upstream commit aa388c72113b7458127b709bdd7d3628af26e9b4 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
093c20a38c
commit
64cd120639
1 changed files with 5 additions and 0 deletions
|
|
@ -1185,6 +1185,11 @@ static int vsock_stream_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 a new issue