From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwZ8R-0001cD-Jc for qemu-devel@nongnu.org; Mon, 16 Jun 2014 11:47:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwZ8Q-0005qZ-NN for qemu-devel@nongnu.org; Mon, 16 Jun 2014 11:47:51 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwZ8Q-0005qQ-Hu for qemu-devel@nongnu.org; Mon, 16 Jun 2014 11:47:50 -0400 From: Peter Maydell Date: Mon, 16 Jun 2014 16:47:49 +0100 Message-Id: <1402933670-3324-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] slirp: Honour vlan/stack in hostfwd_remove commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jan Kiszka , patches@linaro.org 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 --- net/slirp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/slirp.c b/net/slirp.c index 647039e..c171119 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"); -- 1.9.2