From patchwork Fri Dec 18 10:43:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 558818 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 927F91401DE for ; Fri, 18 Dec 2015 21:43:40 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b=Cw18KMBM; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 4338610880; Fri, 18 Dec 2015 02:43:39 -0800 (PST) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 2BC3610873 for ; Fri, 18 Dec 2015 02:43:38 -0800 (PST) Received: from bar2.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 490001E00AD for ; Fri, 18 Dec 2015 03:43:37 -0700 (MST) X-ASG-Debug-ID: 1450435415-03dc533ce222f00001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar2.cudamail.com with ESMTP id O9VVzvbensAcM88e (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 18 Dec 2015 03:43:35 -0700 (MST) X-Barracuda-Envelope-From: simon.horman@netronome.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mail-pf0-f181.google.com) (209.85.192.181) by mx1-pf1.cudamail.com with ESMTPS (RC4-SHA encrypted); 18 Dec 2015 10:43:34 -0000 Received-SPF: none (mx1-pf1.cudamail.com: domain at netronome.com does not designate permitted sender hosts) X-Barracuda-RBL-Trusted-Forwarder: 209.85.192.181 Received: by mail-pf0-f181.google.com with SMTP id u7so845369pfb.1 for ; Fri, 18 Dec 2015 02:43:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=3eJhb6TxUUZX6oLElQJoA1jzXQeyzGOYOrOdWsAPy9o=; b=Cw18KMBMtD8S5BxEJipDwaWhkgDyVIt0K65b04tJ0X2vmQ1c5F7b0I+E1SYm4c2+yD KGa0QtiInkOMhixxPsfo1LYYf4k2JS+GhxuI82Z67sI8rYiW8yWd7MmV8fbUj1ZiEeXQ mUkaWehVLrEirSW/enF1h2WdiKJrOE7Krv30U1Y1/GOpABuiEKyH7vv4cRLMlnXvzpr3 xtr4sTenioPutOC0Ynd1qT0o1QscATYFXFfqDyCy6mm11aTtrL3CgrIAO91J7YdLtVIv 9XoGExN722TlKvrfKPLftKepbGL4azAViONcefWeiJCNA6g0z34Ph2RUayA3qhbp1cXh B0gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3eJhb6TxUUZX6oLElQJoA1jzXQeyzGOYOrOdWsAPy9o=; b=nBHz0flsghp8JCrIXk5ytv2/DtZt6Tm/KrRE2OhlFCSzBmvhyGeUQZRLC17RB3aEwl MN6FEdcZs+2Jt2ehBfV9Mt28byMvpDbzeCyyv2Hf3MVAkEraxLkhqu7A88dzs8V64V2i IYKtSDeDGlPRFBRx0Zs4k3ft+8bh2VbCHfscx2oQEEXJT7YaT1euKs7GfKR2mfZoC1Jq OGeGo0qSh4jiGV57cWYz5YD/XXvtKUyY89GbGO75NfC0GlISUGlhAE+v91V+MViioElL +F0vpgFMweHQ+WaGmztp3NI32HpqjTwPS59gY7Z67Ew7NczTENPbzSCEJJeboYZHxi8b ZI3g== X-Gm-Message-State: ALoCoQnHr/XTU4qMToVHAch7L5WxcaEtko+G9bmeS5ndZ0OJBCC3cF2Enb5kod/yZif0f/zj9diPsGsRJniLXBIOHB5T9Q0Y8A== X-Received: by 10.98.65.67 with SMTP id o64mr4187900pfa.104.1450435414131; Fri, 18 Dec 2015 02:43:34 -0800 (PST) Received: from reginn.isobedori.kobe.vergenet.net (p1027-ipbfp1401kobeminato.hyogo.ocn.ne.jp. [114.152.28.27]) by smtp.gmail.com with ESMTPSA id g68sm17071672pfg.9.2015.12.18.02.43.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Dec 2015 02:43:33 -0800 (PST) X-CudaMail-Envelope-Sender: simon.horman@netronome.com X-Barracuda-Apparent-Source-IP: 114.152.28.27 From: Simon Horman To: Pravin Shelar X-CudaMail-MID: CM-E1-1217005685 X-CudaMail-DTE: 121815 X-CudaMail-Originating-IP: 209.85.192.181 Date: Fri, 18 Dec 2015 19:43:15 +0900 X-ASG-Orig-Subj: [##CM-E1-1217005685##][PATCH net] openvswitch: correct encoding of set tunnel action attributes Message-Id: <1450435395-23775-1-git-send-email-simon.horman@netronome.com> X-Mailer: git-send-email 2.1.4 X-GBUdb-Analysis: 0, 209.85.192.181, Ugly c=0.443535 p=-0.351351 Source Normal X-MessageSniffer-Rules: 0-0-0-5047-c X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1450435415 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.25371 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Cc: dev@openvswitch.org, netdev@vger.kernel.org, Simon Horman Subject: [ovs-dev] [PATCH net] openvswitch: correct encoding of set tunnel action attributes X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" In a set action tunnel attributes should be encoded in a nested action. I noticed this because ovs-dpctl was reporting an error when dumping flows due to the incorrect encoding of tunnel attributes in a set action. Fixes: fc4099f17240 ("openvswitch: Fix egress tunnel info.") Signed-off-by: Simon Horman --- * Lightly tested using ovs-dpctl dump-flows --- net/openvswitch/flow_netlink.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c index 907d6fd28ede..d1bd4a45ca2d 100644 --- a/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c @@ -2434,7 +2434,10 @@ static int set_action_to_attr(const struct nlattr *a, struct sk_buff *skb) if (!start) return -EMSGSIZE; - err = ovs_nla_put_tunnel_info(skb, tun_info); + err = ip_tun_to_nlattr(skb, &tun_info->key, + ip_tunnel_info_opts(tun_info), + tun_info->options_len, + ip_tunnel_info_af(tun_info)); if (err) return err; nla_nest_end(skb, start);