diff options
author | Jiri Benc <jbenc@redhat.com> | 2016-09-30 19:08:06 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-03 08:00:21 +0200 |
commit | 9095e10edd28e1e4a10ba5ca61fb54d9f74f8968 (patch) | |
tree | c0b3479b54587b1d4d8cc962f9850cd983d39500 /include/net/mpls.h | |
parent | openvswitch: mpls: set network header correctly on key extract (diff) | |
download | linux-9095e10edd28e1e4a10ba5ca61fb54d9f74f8968.tar.xz linux-9095e10edd28e1e4a10ba5ca61fb54d9f74f8968.zip |
mpls: move mpls_hdr to a common location
This will be also used by openvswitch.
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/mpls.h')
-rw-r--r-- | include/net/mpls.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/mpls.h b/include/net/mpls.h index 5b3b5addfb08..3ebbc0bb57ff 100644 --- a/include/net/mpls.h +++ b/include/net/mpls.h @@ -19,12 +19,21 @@ #define MPLS_HLEN 4 +struct mpls_shim_hdr { + __be32 label_stack_entry; +}; + static inline bool eth_p_mpls(__be16 eth_type) { return eth_type == htons(ETH_P_MPLS_UC) || eth_type == htons(ETH_P_MPLS_MC); } +static inline struct mpls_shim_hdr *mpls_hdr(const struct sk_buff *skb) +{ + return (struct mpls_shim_hdr *)skb_network_header(skb); +} + /* * For non-MPLS skbs this will correspond to the network header. * For MPLS skbs it will be before the network_header as the MPLS |