net: socket: Don't ignore EINVAL on netdev socket connection

Other errors are treated as failure by net_socket_connect_init(),
but if connect() returns EINVAL, we'll fail silently. Remove the
related exception.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
Stefano Brivio 2022-10-21 11:09:12 +02:00 committed by Jason Wang
parent 5166fe0ae4
commit daf188ff04
1 changed files with 1 additions and 2 deletions

View File

@ -577,8 +577,7 @@ static int net_socket_connect_init(NetClientState *peer,
if (errno == EINTR || errno == EWOULDBLOCK) {
/* continue */
} else if (errno == EINPROGRESS ||
errno == EALREADY ||
errno == EINVAL) {
errno == EALREADY) {
break;
} else {
error_setg_errno(errp, errno, "can't connect socket");