From e7b794282264868d84b3d9a5da222b08a783d8fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Sat, 19 Feb 2022 01:34:50 +0400 Subject: Drop qemu_foo() socket API wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The socket API wrappers were initially introduced in commit 00aa0040 ("Wrap recv to avoid warnings"), but made redundant with commit a2d96af4 ("osdep: add wrappers for socket functions") which fixes the win32 declarations and thus removed the earlier warnings. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- net/socket.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'net/socket.c') diff --git a/net/socket.c b/net/socket.c index 15b410e8d8..c4b80e9228 100644 --- a/net/socket.c +++ b/net/socket.c @@ -120,9 +120,9 @@ static ssize_t net_socket_receive_dgram(NetClientState *nc, const uint8_t *buf, do { if (s->dgram_dst.sin_family != AF_UNIX) { - ret = qemu_sendto(s->fd, buf, size, 0, - (struct sockaddr *)&s->dgram_dst, - sizeof(s->dgram_dst)); + ret = sendto(s->fd, buf, size, 0, + (struct sockaddr *)&s->dgram_dst, + sizeof(s->dgram_dst)); } else { ret = send(s->fd, buf, size, 0); } @@ -163,7 +163,7 @@ static void net_socket_send(void *opaque) uint8_t buf1[NET_BUFSIZE]; const uint8_t *buf; - size = qemu_recv(s->fd, buf1, sizeof(buf1), 0); + size = recv(s->fd, buf1, sizeof(buf1), 0); if (size < 0) { if (errno != EWOULDBLOCK) goto eoc; @@ -198,7 +198,7 @@ static void net_socket_send_dgram(void *opaque) NetSocketState *s = opaque; int size; - size = qemu_recv(s->fd, s->rs.buf, sizeof(s->rs.buf), 0); + size = recv(s->fd, s->rs.buf, sizeof(s->rs.buf), 0); if (size < 0) return; if (size == 0) { @@ -246,7 +246,7 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr, * only on posix systems. */ val = 1; - ret = qemu_setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)); + ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)); if (ret < 0) { error_setg_errno(errp, errno, "can't set socket option SO_REUSEADDR"); @@ -268,8 +268,8 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr, imr.imr_interface.s_addr = htonl(INADDR_ANY); } - ret = qemu_setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, - &imr, sizeof(struct ip_mreq)); + ret = setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, + &imr, sizeof(struct ip_mreq)); if (ret < 0) { error_setg_errno(errp, errno, "can't add socket to multicast group %s", @@ -279,8 +279,8 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr, /* Force mcast msgs to loopback (eg. several QEMUs in same host */ loop = 1; - ret = qemu_setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, - &loop, sizeof(loop)); + ret = setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, + &loop, sizeof(loop)); if (ret < 0) { error_setg_errno(errp, errno, "can't force multicast message to loopback"); @@ -289,8 +289,8 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr, /* If a bind address is given, only send packets from that address */ if (localaddr != NULL) { - ret = qemu_setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, - localaddr, sizeof(*localaddr)); + ret = setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, + localaddr, sizeof(*localaddr)); if (ret < 0) { error_setg_errno(errp, errno, "can't set the default network send interface"); -- cgit v1.2.3