From patchwork Mon Jun 16 15:47:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 31978 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1DD1820E7A for ; Mon, 16 Jun 2014 15:47:52 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id hy10sf20811525vcb.9 for ; Mon, 16 Jun 2014 08:47:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=BlzWTzbFdeOPr7oi9Y0S7S/t/fhJWWGWrhrRuot5JbI=; b=USiltq1wqfNQ1ddBQ1vapVd/eFd747Rfu3voPhl+UAE0LEMlHk7lX3blVL2P11KZQx dozErEuKehwP/879IFhkdQiXN7qDhDBMfmZcl0XAQh0Amr7w5tOhkKsmGa4f0fbUupO0 Trb+PhvJCqKNPwU4G4S7pFyGuKO7bn7pDAMgAfFc/3wLEXBquX1RAVp19+KsiHHYuXmZ amriNsqc3Lxzx8v2bd84RH452rVzXu3Z49s/hMY2aDBxyKKhQus7s/cPiz+ED+Xf0EeD 6k20fV4FXTlJJL8kwCPdhurwJAKalMOHnLYTHjiMJVNuYijgonvqHWzgs/oam96oA2vK ipXg== X-Gm-Message-State: ALoCoQloMI7YD03aEUU0WqWtl46X6IJoRPCoaJAl5In4p9OMxPHM/5Kh9JlIIV1CkRFiGHHo7WWq X-Received: by 10.236.151.114 with SMTP id a78mr5795476yhk.32.1402933671840; Mon, 16 Jun 2014 08:47:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.1 with SMTP id p1ls4416770qga.97.gmail; Mon, 16 Jun 2014 08:47:51 -0700 (PDT) X-Received: by 10.52.164.48 with SMTP id yn16mr624034vdb.57.1402933671776; Mon, 16 Jun 2014 08:47:51 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id fa6si4254457veb.20.2014.06.16.08.47.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 08:47:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.173 as permitted sender) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id db11so6148446veb.4 for ; Mon, 16 Jun 2014 08:47:51 -0700 (PDT) X-Received: by 10.58.133.6 with SMTP id oy6mr5472494veb.25.1402933671709; Mon, 16 Jun 2014 08:47:51 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp143934vcb; Mon, 16 Jun 2014 08:47:51 -0700 (PDT) X-Received: by 10.180.99.99 with SMTP id ep3mr5083664wib.42.1402933670774; Mon, 16 Jun 2014 08:47:50 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id jt5si4973714wjc.4.2014.06.16.08.47.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 16 Jun 2014 08:47:50 -0700 (PDT) Received-SPF: none (google.com: pm215@archaic.org.uk does not designate permitted sender hosts) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WwZ8Q-0000s5-1L; Mon, 16 Jun 2014 16:47:50 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Jan Kiszka Subject: [PATCH] slirp: Honour vlan/stack in hostfwd_remove commands Date: Mon, 16 Jun 2014 16:47:49 +0100 Message-Id: <1402933670-3324-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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");