diff options
-rw-r--r-- | misc.c | 4 | ||||
-rw-r--r-- | socket.c | 5 | ||||
-rw-r--r-- | tcp_subr.c | 8 | ||||
-rw-r--r-- | udp.c | 2 |
4 files changed, 9 insertions, 10 deletions
@@ -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 */ @@ -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; @@ -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; @@ -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; |