From patchwork Tue Apr 30 23:27:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1093506 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44tyPf1LhGz9s5c for ; Wed, 1 May 2019 09:28:05 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 28CE91E10; Tue, 30 Apr 2019 23:28:01 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 88BAD1C5A for ; Tue, 30 Apr 2019 23:27:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id E44345F4 for ; Tue, 30 Apr 2019 23:27:36 +0000 (UTC) X-Originating-IP: 66.170.99.95 Received: from sigill.benpfaff.org (unknown [66.170.99.95]) (Authenticated sender: blp@ovn.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 0A13F1C0004; Tue, 30 Apr 2019 23:27:33 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Tue, 30 Apr 2019 16:27:19 -0700 Message-Id: <20190430232728.31093-1-blp@ovn.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 01/10] ofp-actions: Make encap action really require OF1.3+. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org This action is only supported in OpenFlow 1.3 and later, but the parser from text allowed it in earlier versions, which could cause confusion, e.g.: $ ovs-ofctl parse-flow 'actions=encap(ethernet())' usable protocols: any chosen protocol: OpenFlow10-table_id 2019-04-30T20:19:59Z|00001|ofp_actions|WARN|unknown OpenFlow10 action for vendor 0x2320 and type 46 2019-04-30T20:19:59Z|00002|ofp_actions|WARN|bad action at offset 0 (OFPBAC_BAD_VENDOR_TYPE): 00000000 ff ff 00 10 00 00 23 20-00 2e 00 00 00 00 00 00 OFPT_FLOW_MOD (xid=0x1): ***decode error: OFPBAC_BAD_VENDOR_TYPE*** 00000000 01 0e 00 58 00 00 00 01-00 38 20 ff 00 00 00 00 |...X.....8 .....| 00000010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................| 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................| 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 80 00 |................| 00000040 ff ff ff ff ff ff 00 00-ff ff 00 10 00 00 23 20 |..............# | 00000050 00 2e 00 00 00 00 00 00- |........ | Signed-off-by: Ben Pfaff Acked-by: Numan Siddique for the patches - 1 to 8 of --- lib/ofp-actions.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index 1a24063d087c..182277da85cb 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -4430,6 +4430,8 @@ parse_ed_props(const uint16_t prop_class, char **arg, int *n_props, struct ofpbu static char * OVS_WARN_UNUSED_RESULT parse_ENCAP(char *arg, const struct ofpact_parse_params *pp) { + *pp->usable_protocols &= OFPUTIL_P_OF13_UP; + struct ofpact_encap *encap; char *key, *value, *str; char *error = NULL;