diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2019-02-14 22:26:50 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2019-02-14 22:26:50 +0100 |
commit | d869f86645fc07dc83b89b68f1a22d91ebe29439 (patch) | |
tree | a3c2c1167bb34c8d0367d77e1a5734fc842d9f30 /net/ipv4/gre_demux.c | |
parent | 030fc443aef663df71cd834331fd8f1ec10c30c0 (diff) | |
parent | 74e96711e3379fc66630f2a1d184947f80cf2c48 (diff) | |
download | linux-d869f86645fc07dc83b89b68f1a22d91ebe29439.tar.gz |
Merge branch 'linus' into irq/core
Pick up upstream changes to avoid conflicts for pending patches.
Diffstat (limited to 'net/ipv4/gre_demux.c')
-rw-r--r-- | net/ipv4/gre_demux.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/ipv4/gre_demux.c b/net/ipv4/gre_demux.c index a4bf22ee3aed..7c4a41dc04bb 100644 --- a/net/ipv4/gre_demux.c +++ b/net/ipv4/gre_demux.c @@ -25,6 +25,7 @@ #include <linux/spinlock.h> #include <net/protocol.h> #include <net/gre.h> +#include <net/erspan.h> #include <net/icmp.h> #include <net/route.h> @@ -119,6 +120,22 @@ int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi, hdr_len += 4; } tpi->hdr_len = hdr_len; + + /* ERSPAN ver 1 and 2 protocol sets GRE key field + * to 0 and sets the configured key in the + * inner erspan header field + */ + if (greh->protocol == htons(ETH_P_ERSPAN) || + greh->protocol == htons(ETH_P_ERSPAN2)) { + struct erspan_base_hdr *ershdr; + + if (!pskb_may_pull(skb, nhs + hdr_len + sizeof(*ershdr))) + return -EINVAL; + + ershdr = (struct erspan_base_hdr *)options; + tpi->key = cpu_to_be32(get_session_id(ershdr)); + } + return hdr_len; } EXPORT_SYMBOL(gre_parse_header); |