diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-02-12 17:09:52 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-02-12 20:47:42 +0100 |
commit | fdbfba8cbf04b587f9bab11b8e6a87afc38556e5 (patch) | |
tree | 37a867a670f31469c4fd0388601202aabca3f763 /slirp/tcp_subr.c | |
parent | 0b5e750bea635b167eb03d86c3d9a09bbd43bc06 (diff) |
slirp: remove slirp_ prefix for socket wrappers
QEMU wraps the socket functions in os-win32.h, but in commit
a9d8b3ec4385793815d71217857304, the header inclusion was dropped,
breaking libslirp on Windows.
There are already a few socket functions that are wrapped in libslirp,
with "slirp_" prefix, but many of them are missing, and we are going
to wrap the missing functions in a second patch.
Using "slirp_" prefix avoids the conflict with socket function #define
wrappers in QEMU os-win32.h, but they are quite intrusive. In the end,
the functions should behave the same as original one, but with errno
being set. To avoid the churn, and potential confusion, remove the
"slirp_" prefix. A series of #undef is necessary until libslirp is
made standalone to prevent the #define conflict with QEMU.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20190212160953.29051-2-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.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c index cda94815f6..262a42d6c8 100644 --- a/slirp/tcp_subr.c +++ b/slirp/tcp_subr.c @@ -337,7 +337,7 @@ tcp_close(struct tcpcb *tp) if (so == slirp->tcp_last_so) slirp->tcp_last_so = &slirp->tcb; so->slirp->cb->unregister_poll_fd(so->s, so->slirp->opaque); - slirp_closesocket(so->s); + closesocket(so->s); sbfree(&so->so_rcv); sbfree(&so->so_snd); sofree(so); @@ -416,9 +416,9 @@ int tcp_fconnect(struct socket *so, unsigned short af) so->slirp->cb->register_poll_fd(so->s, so->slirp->opaque); slirp_socket_set_fast_reuse(s); opt = 1; - slirp_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(opt)); + setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(opt)); opt = 1; - slirp_setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt)); + setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt)); addr = so->fhost.ss; DEBUG_CALL(" connect()ing"); @@ -489,7 +489,7 @@ void tcp_connect(struct socket *inso) so->slirp->cb->register_poll_fd(so->s, so->slirp->opaque); slirp_socket_set_fast_reuse(s); opt = 1; - slirp_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int)); + setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int)); slirp_socket_set_nodelay(s); so->fhost.ss = addr; @@ -499,7 +499,7 @@ void tcp_connect(struct socket *inso) if (inso->so_state & SS_FACCEPTONCE) { /* If we only accept once, close the accept() socket */ so->slirp->cb->unregister_poll_fd(so->s, so->slirp->opaque); - slirp_closesocket(so->s); + closesocket(so->s); /* Don't select it yet, even though we have an FD */ /* if it's not FACCEPTONCE, it's already NOFDREF */ |