Skip to content
Snippets Groups Projects
Commit 006c3fa7 authored by Laurent Vivier's avatar Laurent Vivier Committed by Jason Wang
Browse files

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: default avatarDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: default avatarLaurent Vivier <lvivier@redhat.com>
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
parent 71e11da1
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......@@ -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;
}
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment