summaryrefslogtreecommitdiffstats
path: root/net/slirp.c
diff options
context:
space:
mode:
authorPeter Maydell2014-06-16 17:47:49 +0200
committerMichael Tokarev2014-09-02 20:38:16 +0200
commit70381662aa97b294f3c81a085ed143f37f0ab0cb (patch)
tree42ba5be1737ae9938cc96e4f4c8cb9c5279b2e13 /net/slirp.c
parenthmp: fix MemdevList memory leak (diff)
downloadqemu-70381662aa97b294f3c81a085ed143f37f0ab0cb.tar.gz
qemu-70381662aa97b294f3c81a085ed143f37f0ab0cb.tar.xz
qemu-70381662aa97b294f3c81a085ed143f37f0ab0cb.zip
slirp: Honour vlan/stack in hostfwd_remove commands
The hostfwd_add and hostfwd_remove monitor commands allow the user to optionally specify a vlan/stack tuple. hostfwd_add honours this, but hostfwd_remove does not (it looks up the tuple but then ignores the SlirpState it has looked up and always uses the first stack in the list anyway). Correct this to honour what the user requested. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'net/slirp.c')
-rw-r--r--net/slirp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/slirp.c b/net/slirp.c
index 647039ec39..c171119dad 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -345,8 +345,7 @@ void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict)
host_port = atoi(p);
- err = slirp_remove_hostfwd(QTAILQ_FIRST(&slirp_stacks)->slirp, is_udp,
- host_addr, host_port);
+ err = slirp_remove_hostfwd(s->slirp, is_udp, host_addr, host_port);
monitor_printf(mon, "host forwarding rule for %s %s\n", src_str,
err ? "not found" : "removed");