From patchwork Mon Jun 12 22:28:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 774884 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.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 3wmp9B0Zz7z9s06 for ; Tue, 13 Jun 2017 08:53:50 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 94B66C7B; Mon, 12 Jun 2017 22:53:48 +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 582DDBC7 for ; Mon, 12 Jun 2017 22:53:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from slow1-d.mail.gandi.net (slow1-d.mail.gandi.net [217.70.178.86]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id B0398FD for ; Mon, 12 Jun 2017 22:53:47 +0000 (UTC) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by slow1-d.mail.gandi.net (Postfix) with ESMTP id E7A3347AAA3 for ; Tue, 13 Jun 2017 00:29:57 +0200 (CEST) Received: from mfilter13-d.gandi.net (mfilter13-d.gandi.net [217.70.178.141]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 45303FB883; Tue, 13 Jun 2017 00:29:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter13-d.gandi.net Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter13-d.gandi.net (mfilter13-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id X8KlDEG1U38C; Tue, 13 Jun 2017 00:29:55 +0200 (CEST) X-Originating-IP: 208.91.2.3 Received: from sigabrt.benpfaff.org (unknown [208.91.2.3]) (Authenticated sender: blp@ovn.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id CDC20FB87D; Tue, 13 Jun 2017 00:29:54 +0200 (CEST) From: Ben Pfaff To: dev@openvswitch.org Date: Mon, 12 Jun 2017 15:28:56 -0700 Message-Id: <20170612222856.14108-32-blp@ovn.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170612222856.14108-1-blp@ovn.org> References: <20170612222856.14108-1-blp@ovn.org> 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 31/31] fixup: Allow non-Ethernet packets anywhere. 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: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Signed-off-by: Ben Pfaff --- ofproto/ofproto.c | 6 ------ tests/ofproto.at | 23 ----------------------- 2 files changed, 29 deletions(-) diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 5794dfd54fc5..f5aaf0b1fd44 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -3483,12 +3483,6 @@ ofproto_packet_out_init(struct ofproto *ofproto, return OFPERR_OFPBRC_BUFFER_UNKNOWN; } - /* NON-PTAP bridge should accept only Ethernet packet. */ - if (!ofproto->packet_type_aware && - po->flow_metadata.flow.packet_type != htonl(PT_ETH)) { - return OFPERR_OFPBRC_BAD_PACKET; - } - /* Ensure that the L3 header is 32-bit aligned. */ opo->packet = dp_packet_clone_data_with_headroom(po->packet, po->packet_len, 2); diff --git a/tests/ofproto.at b/tests/ofproto.at index 3dd5cbea0063..d466ae54cc61 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -4221,29 +4221,6 @@ OFPT_BARRIER_REPLY (OF1.3): OVS_VSWITCHD_STOP AT_CLEANUP -dnl This test checks that NON-PTAP bridge rejects 1.5 packet-out with packet_type PT_IPV4. -AT_SETUP([ofproto - packet-out with set_field metadata with packet_type PT_IPV4 on NON-PTAP bridge (OpenFlow 1.5)]) -OVS_VSWITCHD_START - -AT_CHECK([ - ovs-vsctl set bridge br0 other-config:packet-type-aware=false -], [0]) - -AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=controller packet=4500002012344000ff1155670a0000140a00001e006400c8000cea78ffffffff packet_type(1,0x800) actions=set_field:0xfafafafa5a5a5a5a->metadata,controller"], -[1], [], [dnl -OFPT_ERROR (OF1.5) (xid=0x4): OFPBRC_BAD_PACKET -OFPT_PACKET_OUT (OF1.5) (xid=0x4): -(***truncated to 64 bytes from 104***) -00000000 06 0d 00 68 00 00 00 04-ff ff ff ff 00 20 00 00 |...h......... ..| -00000010 00 01 00 14 80 00 58 04-00 01 08 00 80 00 00 04 |......X.........| -00000020 ff ff ff fd 00 00 00 00-00 19 00 10 80 00 04 08 |................| -00000030 fa fa fa fa 5a 5a 5a 5a-00 00 00 10 ff ff ff fd |....ZZZZ........| -]) - -OVS_VSWITCHD_STOP -AT_CLEANUP - - dnl This test checks that metadata is encoded in packet_in structures, dnl supported by NXAST. AT_SETUP([ofproto - packet-out with metadata (NXM)])