Skip to content

Commit

Permalink
net: socket: Don't ignore EINVAL on netdev socket connection
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sbrivio-rh authored and jasowang committed Oct 28, 2022
1 parent 5166fe0 commit daf188f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/socket.c
Expand Up @@ -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");
Expand Down

0 comments on commit daf188f

Please sign in to comment.