summary refs log tree commit diff stats
path: root/slirp/tcp_subr.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-01-17 15:43:33 +0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-02-07 15:49:08 +0200
commit44b4ff248802d957b819ae49c66a29f311078213 (patch)
tree8d5508512383aa5801602702df68eaffe368943a /slirp/tcp_subr.c
parentaaa0c642b1de62d5a69b6d4bfdaa91e4b65c5518 (diff)
downloadfocaccia-qemu-44b4ff248802d957b819ae49c66a29f311078213.tar.gz
focaccia-qemu-44b4ff248802d957b819ae49c66a29f311078213.zip
slirp: generalize guestfwd with a callback based approach
Instead of calling into QEMU chardev directly, and mixing it with
slirp_add_exec() handling, add a new function slirp_add_guestfwd()
which takes a write callback.

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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
index 23a841f26e..4e81736d6f 100644
--- a/slirp/tcp_subr.c
+++ b/slirp/tcp_subr.c
@@ -964,9 +964,9 @@ int tcp_ctl(struct socket *so)
         for (ex_ptr = slirp->guestfwd_list; ex_ptr; ex_ptr = ex_ptr->ex_next) {
             if (ex_ptr->ex_fport == so->so_fport &&
                 so->so_faddr.s_addr == ex_ptr->ex_addr.s_addr) {
-                if (ex_ptr->ex_chardev) {
+                if (ex_ptr->write_cb) {
                     so->s = -1;
-                    so->chardev = ex_ptr->ex_chardev;
+                    so->guestfwd = ex_ptr;
                     return 1;
                 }
                 DEBUG_MISC(" executing %s", ex_ptr->ex_exec);