From patchwork Fri May 13 21:17:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Stringer X-Patchwork-Id: 622137 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3r62kK1CdFz9t5x for ; Sat, 14 May 2016 07:17:28 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 695A610A5C; Fri, 13 May 2016 14:17:27 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 2586410A5B for ; Fri, 13 May 2016 14:17:26 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 92B7C4202D6 for ; Fri, 13 May 2016 15:17:25 -0600 (MDT) X-ASG-Debug-ID: 1463174244-09eadd5dc3345a30001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar5.cudamail.com with ESMTP id lVwi1BWvg2axRh8f (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 13 May 2016 15:17:24 -0600 (MDT) X-Barracuda-Envelope-From: joe@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO relay4-d.mail.gandi.net) (217.70.183.196) by mx3-pf2.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 13 May 2016 21:17:24 -0000 Received-SPF: pass (mx3-pf2.cudamail.com: SPF record at ovn.org designates 217.70.183.196 as permitted sender) X-Barracuda-Apparent-Source-IP: 217.70.183.196 X-Barracuda-RBL-IP: 217.70.183.196 Received: from mfilter24-d.gandi.net (mfilter24-d.gandi.net [217.70.178.152]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id 91BB51720A4; Fri, 13 May 2016 23:17:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter24-d.gandi.net Received: from relay4-d.mail.gandi.net ([IPv6:::ffff:217.70.183.196]) by mfilter24-d.gandi.net (mfilter24-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 8fRZs749bPtL; Fri, 13 May 2016 23:17:21 +0200 (CEST) X-Originating-IP: 208.91.1.34 Received: from debian-d3.eng.vmware.com (unknown [208.91.1.34]) (Authenticated sender: joe@ovn.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 3920A17209C; Fri, 13 May 2016 23:17:19 +0200 (CEST) X-CudaMail-Envelope-Sender: joe@ovn.org From: Joe Stringer To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V2-512048496 X-CudaMail-DTE: 051316 X-CudaMail-Originating-IP: 217.70.183.196 Date: Fri, 13 May 2016 14:17:12 -0700 X-ASG-Orig-Subj: [##CM-V2-512048496##][PATCH] ofproto-dpif-upcall: Fix UFID usage with flow_modify. Message-Id: <1463174232-12410-1-git-send-email-joe@ovn.org> X-Mailer: git-send-email 2.1.4 X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1463174244 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH] ofproto-dpif-upcall: Fix UFID usage with flow_modify. 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" As per the delete_op_init{,__}() functions, the UFID should only be passed down if ukey->ufid_present is set. Otherwise it is possible to request a flow modification only using a UFID in a datapath that doesn't support UFID, which will fail. Fixes: 43b2f131a229 ("ofproto: Allow in-place modifications of datapath flows.") Signed-off-by: Joe Stringer Acked-by: Ben Pfaff --- ofproto/ofproto-dpif-upcall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index 0543c78e8790..2280e240ee76 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -1930,7 +1930,7 @@ modify_op_init(struct ukey_op *op, struct udpif_key *ukey) op->dop.u.flow_put.key_len = ukey->key_len; op->dop.u.flow_put.mask = ukey->mask; op->dop.u.flow_put.mask_len = ukey->mask_len; - op->dop.u.flow_put.ufid = &ukey->ufid; + op->dop.u.flow_put.ufid = ukey->ufid_present ? &ukey->ufid: NULL; op->dop.u.flow_put.pmd_id = ukey->pmd_id; op->dop.u.flow_put.stats = NULL; ukey_get_actions(ukey, &op->dop.u.flow_put.actions,