Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
net: socket: prepare to cleanup net_init_socket()
Use directly net_socket_fd_init_stream() and net_socket_fd_init_dgram()
when the socket type is already known.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
  • Loading branch information
vivier authored and jasowang committed Jul 7, 2023
1 parent 71e11da commit 006c3fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/socket.c
Expand Up @@ -587,7 +587,7 @@ static int net_socket_connect_init(NetClientState *peer,
break;
}
}
s = net_socket_fd_init(peer, model, name, fd, connected, NULL, errp);
s = net_socket_fd_init_stream(peer, model, name, fd, connected);
if (!s) {
return -1;
}
Expand Down Expand Up @@ -629,7 +629,7 @@ static int net_socket_mcast_init(NetClientState *peer,
return -1;
}

s = net_socket_fd_init(peer, model, name, fd, 0, NULL, errp);
s = net_socket_fd_init_dgram(peer, model, name, fd, 0, NULL, errp);
if (!s) {
return -1;
}
Expand Down Expand Up @@ -683,7 +683,7 @@ static int net_socket_udp_init(NetClientState *peer,
}
qemu_socket_set_nonblock(fd);

s = net_socket_fd_init(peer, model, name, fd, 0, NULL, errp);
s = net_socket_fd_init_dgram(peer, model, name, fd, 0, NULL, errp);
if (!s) {
return -1;
}
Expand Down

0 comments on commit 006c3fa

Please sign in to comment.