aboutsummaryrefslogtreecommitdiff
path: root/slirp/tcp_subr.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-01-17 15:43:58 +0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-02-07 15:49:08 +0200
commit3e0fad3aa5f9f36566ac2815a54288d214e58689 (patch)
treef2714d8506fe29bcaaaa4edabe341ee8befddc34 /slirp/tcp_subr.c
parentdeaeb3f71d1fdf199d5b949e8575303486e3dec8 (diff)
slirp: pass opaque to all callbacks
This is friendlier for FFI bindings. 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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
index e35628a892..cda94815f6 100644
--- a/slirp/tcp_subr.c
+++ b/slirp/tcp_subr.c
@@ -336,7 +336,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;
- so->slirp->cb->unregister_poll_fd(so->s);
+ so->slirp->cb->unregister_poll_fd(so->s, so->slirp->opaque);
slirp_closesocket(so->s);
sbfree(&so->so_rcv);
sbfree(&so->so_snd);
@@ -413,7 +413,7 @@ int tcp_fconnect(struct socket *so, unsigned short af)
struct sockaddr_storage addr;
slirp_set_nonblock(s);
- so->slirp->cb->register_poll_fd(so->s);
+ 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));
@@ -486,7 +486,7 @@ void tcp_connect(struct socket *inso)
return;
}
slirp_set_nonblock(s);
- so->slirp->cb->register_poll_fd(so->s);
+ 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));
@@ -498,7 +498,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 */
- so->slirp->cb->unregister_poll_fd(so->s);
+ so->slirp->cb->unregister_poll_fd(so->s, so->slirp->opaque);
slirp_closesocket(so->s);
/* Don't select it yet, even though we have an FD */