aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--misc.c4
-rw-r--r--socket.c5
-rw-r--r--tcp_subr.c8
-rw-r--r--udp.c2
4 files changed, 9 insertions, 10 deletions
diff --git a/misc.c b/misc.c
index a2abe2d..10c233f 100644
--- a/misc.c
+++ b/misc.c
@@ -207,9 +207,9 @@ int fork_exec(struct socket *so, const char *ex, int do_pty)
} while (so->s < 0 && errno == EINTR);
closesocket(s);
opt = 1;
- setsockopt(so->s, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(int));
+ qemu_setsockopt(so->s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(int));
opt = 1;
- setsockopt(so->s, SOL_SOCKET, SO_OOBINLINE, (char *)&opt, sizeof(int));
+ qemu_setsockopt(so->s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int));
socket_set_nonblock(so->s);
/* Append the telnet options now */
diff --git a/socket.c b/socket.c
index 8786c6f..b7e9e49 100644
--- a/socket.c
+++ b/socket.c
@@ -633,8 +633,7 @@ struct socket *tcp_listen(Slirp *slirp, uint32_t haddr, u_int hport,
addr.sin_port = hport;
if (((s = qemu_socket(AF_INET, SOCK_STREAM, 0)) < 0) ||
- (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(int)) <
- 0) ||
+ (qemu_setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(int)) < 0) ||
(bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) ||
(listen(s, 1) < 0)) {
int tmperrno = errno; /* Don't clobber the real reason we failed */
@@ -649,7 +648,7 @@ struct socket *tcp_listen(Slirp *slirp, uint32_t haddr, u_int hport,
#endif
return NULL;
}
- setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *)&opt, sizeof(int));
+ qemu_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int));
getsockname(s, (struct sockaddr *)&addr, &addrlen);
so->so_fport = addr.sin_port;
diff --git a/tcp_subr.c b/tcp_subr.c
index 9c93612..6881f1f 100644
--- a/tcp_subr.c
+++ b/tcp_subr.c
@@ -336,9 +336,9 @@ int tcp_fconnect(struct socket *so)
socket_set_nonblock(s);
opt = 1;
- setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(opt));
+ qemu_setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
opt = 1;
- setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *)&opt, sizeof(opt));
+ qemu_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(opt));
addr.sin_family = AF_INET;
if ((so->so_faddr.s_addr & slirp->vnetwork_mask.s_addr) ==
@@ -426,9 +426,9 @@ void tcp_connect(struct socket *inso)
}
socket_set_nonblock(s);
opt = 1;
- setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(int));
+ qemu_setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(int));
opt = 1;
- setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *)&opt, sizeof(int));
+ qemu_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int));
socket_set_nodelay(s);
so->so_fport = addr.sin_port;
diff --git a/udp.c b/udp.c
index 8206e02..dfc314a 100644
--- a/udp.c
+++ b/udp.c
@@ -362,7 +362,7 @@ struct socket *udp_listen(Slirp *slirp, uint32_t haddr, u_int hport,
udp_detach(so);
return NULL;
}
- setsockopt(so->s, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(int));
+ qemu_setsockopt(so->s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(int));
getsockname(so->s, (struct sockaddr *)&addr, &addrlen);
so->so_fport = addr.sin_port;