From: Thomas F Herbert <thomasfherbert@gmail.com>
To: netdev@vger.kernel.org, pshelar@nicira.com
Cc: therbert@redhat.com, dev@openvswitch.org,
Thomas F Herbert <thomasfherbert@gmail.com>
Subject: [PATCH net-next V14 2/3] openvswitch: Check for vlan ethernet types for 8021.q or 802.1ad
Date: Wed, 30 Sep 2015 23:32:59 -0400 [thread overview]
Message-ID: <1443670380-4245-3-git-send-email-thomasfherbert@gmail.com> (raw)
In-Reply-To: <1443670380-4245-1-git-send-email-thomasfherbert@gmail.com>
Signed-off-by: Thomas F Herbert <thomasfherbert@gmail.com>
---
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
--
2.4.3
next prev parent reply other threads:[~2015-10-01 3:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-01 3:32 [PATCH net-next V14 0/3] openvswitch: Add support for 802.1ad Thomas F Herbert
2015-10-01 3:32 ` [PATCH net-next V14 1/3] openvswitch: 802.1ad uapi changes Thomas F Herbert
2015-10-01 3:32 ` Thomas F Herbert [this message]
[not found] ` <1443670380-4245-1-git-send-email-thomasfherbert-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-01 3:33 ` [PATCH net-next V14 3/3] openvswitch: 802.1ad: Flow handling, actions, vlan parsing and netlink attributes Thomas F Herbert
2015-10-02 21:48 ` Thomas F Herbert
[not found] ` <560EFBB2.707-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-02 21:59 ` Pravin Shelar
2015-10-06 0:27 ` Pravin Shelar
2015-10-02 17:38 ` [PATCH net-next V14 0/3] openvswitch: Add support for 802.1ad Pravin Shelar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1443670380-4245-3-git-send-email-thomasfherbert@gmail.com \
--to=thomasfherbert@gmail.com \
--cc=dev@openvswitch.org \
--cc=netdev@vger.kernel.org \
--cc=pshelar@nicira.com \
--cc=therbert@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).