From patchwork Wed Sep 3 06:35:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 385402 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 29CC6140219 for ; Wed, 3 Sep 2014 16:36:34 +1000 (EST) Received: from localhost ([::1]:42616 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP4BE-0002k1-80 for incoming@patchwork.ozlabs.org; Wed, 03 Sep 2014 02:36:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP4AX-0001Sd-2E for qemu-devel@nongnu.org; Wed, 03 Sep 2014 02:35:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XP4AL-0005bX-PM for qemu-devel@nongnu.org; Wed, 03 Sep 2014 02:35:49 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:60538) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP4AL-0005bC-EG; Wed, 03 Sep 2014 02:35:37 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 645E14075F; Wed, 3 Sep 2014 10:35:36 +0400 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 451E46DF; Wed, 3 Sep 2014 10:35:36 +0400 (MSK) Received: (nullmailer pid 1622 invoked by uid 1000); Wed, 03 Sep 2014 06:35:36 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Wed, 3 Sep 2014 10:35:35 +0400 Message-Id: <1409726135-1547-11-git-send-email-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1409726135-1547-1-git-send-email-mjt@tls.msk.ru> References: <1409726135-1547-1-git-send-email-mjt@tls.msk.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 86.62.121.231 Cc: qemu-trivial@nongnu.org, Peter Maydell , Michael Tokarev Subject: [Qemu-devel] [PULL 10/10] slirp: Honour vlan/stack in hostfwd_remove commands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Peter Maydell 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 Signed-off-by: Michael Tokarev --- 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");