From patchwork Thu Sep 24 17:58:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas F Herbert X-Patchwork-Id: 522476 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 407DA14029C for ; Fri, 25 Sep 2015 03:59:08 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=njUXWWjs; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 4736E22C3B7; Thu, 24 Sep 2015 10:59:07 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 09AD222C3B7 for ; Thu, 24 Sep 2015 10:59:06 -0700 (PDT) Received: from bar3.cudamail.com (bar1 [192.168.15.1]) by mx3v1.cudamail.com (Postfix) with ESMTP id 0DAA5618CCF for ; Thu, 24 Sep 2015 11:59:04 -0600 (MDT) X-ASG-Debug-ID: 1443117543-03dd7b6567800d0001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar3.cudamail.com with ESMTP id Q6shw4xyPlX83r8u (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 24 Sep 2015 11:59:03 -0600 (MDT) X-Barracuda-Envelope-From: thomasfherbert@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mail-qg0-f53.google.com) (209.85.192.53) by mx3-pf3.cudamail.com with ESMTPS (RC4-SHA encrypted); 24 Sep 2015 17:59:01 -0000 Received-SPF: pass (mx3-pf3.cudamail.com: SPF record at _netblocks.google.com designates 209.85.192.53 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.192.53 X-Barracuda-RBL-IP: 209.85.192.53 Received: by qgx61 with SMTP id 61so50787211qgx.3 for ; Thu, 24 Sep 2015 10:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AANXrZVTHUwfeD1lNn3cdt8waObcCa98qojvUrAlsls=; b=njUXWWjsWIBNgxItDT+Vh+zobhqRdQt5LuTc878u/SG9J4bC03qBpsxfOcXGQzRFfy rzPFIjLxSXK6lOBfd0eYg2d8d6D1847PcpE32eQQwOKy0XiKBnKIFv1r5EFMg9kdRe5O E+kqZOLR+zIannnDTCCi+K92RNwqSsmEcXdFGzhQGn+OzdRYBYYtLlIWuAc26t0nUUL1 jDjzPLZR5Q+qQt7gMockbsNJqrO8WmzLdSxwSf1/CQdQA9huZDE+DY+B24CMNGG0vSkX tNd8Rpn+YHSEns/V0puoDcTf0DBTAY4mRJfg1E8/9KOE9rtBfaSPvij5gYe3yilJ0pSO 8LEg== X-Received: by 10.140.85.135 with SMTP id n7mr1268108qgd.53.1443117541530; Thu, 24 Sep 2015 10:59:01 -0700 (PDT) Received: from localhost.localdomain (pool-173-53-26-105.rcmdva.fios.verizon.net. [173.53.26.105]) by smtp.gmail.com with ESMTPSA id s90sm4923089qki.46.2015.09.24.10.59.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Sep 2015 10:59:00 -0700 (PDT) X-CudaMail-Envelope-Sender: thomasfherbert@gmail.com From: Thomas F Herbert To: netdev@vger.kernel.org, pshelar@nicira.com X-CudaMail-MID: CM-V3-923052744 X-CudaMail-DTE: 092415 X-CudaMail-Originating-IP: 209.85.192.53 Date: Thu, 24 Sep 2015 13:58:17 -0400 X-ASG-Orig-Subj: [##CM-V3-923052744##][PATCH 2/3] Check for vlan ethernet types for 8021.q or 802.1ad Message-Id: <1443117498-19123-3-git-send-email-thomasfherbert@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1443117498-19123-1-git-send-email-thomasfherbert@gmail.com> References: <1443117498-19123-1-git-send-email-thomasfherbert@gmail.com> X-GBUdb-Analysis: 0, 209.85.192.53, Ugly c=0.377531 p=-0.435897 Source Normal X-MessageSniffer-Rules: 0-0-0-4025-c X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1443117543 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.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=3.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_SC5_MJ1963, DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.22863 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 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 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Cc: dev@openvswitch.org, therbert@redhat.com Subject: [ovs-dev] [PATCH 2/3] Check for vlan ethernet types for 8021.q or 802.1ad 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" Signed-off-by: Thomas F Herbert --- include/linux/if_vlan.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 67ce5bd..88d1be4 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -627,6 +627,23 @@ static inline netdev_features_t vlan_features_check(const struct sk_buff *skb, return features; } +/** + * eth_type_vlan - check for valid vlan ether type. + * @ethertype: ether type to check + * + * Returns true if the ether type is a vlan ether type. + */ +static inline bool eth_type_vlan(__be16 ethertype) +{ + switch (ethertype) { + case (htons(ETH_P_8021Q)): + return true; + case (htons(ETH_P_8021AD)): + return true; + default: + return false; + } +} /** * compare_vlan_header - Compare two vlan headers