aboutsummaryrefslogtreecommitdiff
path: root/slirp/tcp_subr.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-01-17 15:43:40 +0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-02-07 15:49:08 +0200
commit707bd47ef3cf778b691d9e0df2ede3ec4c3fe771 (patch)
treee24e8b1c331a0acd7084d8edcb00b779598b7e2b /slirp/tcp_subr.c
parent90329416405f6660a6f54592f70850c2917f8148 (diff)
slirp: replace most qemu socket utilities with slirp own version
qemu_set_nonblock() is slightly more problematic and will be dealt with in a separate patch. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/tcp_subr.c')
-rw-r--r--slirp/tcp_subr.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
index 4e81736d6f..3567f320ff 100644
--- a/slirp/tcp_subr.c
+++ b/slirp/tcp_subr.c
@@ -337,7 +337,7 @@ tcp_close(struct tcpcb *tp)
/* clobber input socket cache if we're closing the cached connection */
if (so == slirp->tcp_last_so)
slirp->tcp_last_so = &slirp->tcb;
- closesocket(so->s);
+ slirp_closesocket(so->s);
sbfree(&so->so_rcv);
sbfree(&so->so_snd);
sofree(so);
@@ -407,17 +407,17 @@ int tcp_fconnect(struct socket *so, unsigned short af)
DEBUG_CALL("tcp_fconnect");
DEBUG_ARG("so = %p", so);
- ret = so->s = qemu_socket(af, SOCK_STREAM, 0);
+ ret = so->s = slirp_socket(af, SOCK_STREAM, 0);
if (ret >= 0) {
int opt, s=so->s;
struct sockaddr_storage addr;
qemu_set_nonblock(s);
- socket_set_fast_reuse(s);
+ slirp_socket_set_fast_reuse(s);
opt = 1;
- qemu_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(opt));
+ slirp_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(opt));
opt = 1;
- qemu_setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
+ slirp_setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
addr = so->fhost.ss;
DEBUG_CALL(" connect()ing");
@@ -485,10 +485,10 @@ void tcp_connect(struct socket *inso)
return;
}
qemu_set_nonblock(s);
- socket_set_fast_reuse(s);
+ slirp_socket_set_fast_reuse(s);
opt = 1;
- qemu_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int));
- socket_set_nodelay(s);
+ slirp_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int));
+ slirp_socket_set_nodelay(s);
so->fhost.ss = addr;
sotranslate_accept(so);
@@ -496,7 +496,7 @@ void tcp_connect(struct socket *inso)
/* Close the accept() socket, set right state */
if (inso->so_state & SS_FACCEPTONCE) {
/* If we only accept once, close the accept() socket */
- closesocket(so->s);
+ slirp_closesocket(so->s);
/* Don't select it yet, even though we have an FD */
/* if it's not FACCEPTONCE, it's already NOFDREF */