diff options
author | Greg Kroah-Hartman | 2019-01-28 08:44:58 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2019-01-28 08:44:58 +0100 |
commit | c9381e185fdcf86e9d7966d638c933894f87cdd7 (patch) | |
tree | d99259aded85a3fb95e9d52c56d9d3a0cfdfe460 /net/ipv4/gre_demux.c | |
parent | usb: ftdi-elan: Fix if == else warnings in ftdi_elan_respond_engine (diff) | |
parent | Linux 5.0-rc4 (diff) | |
download | kernel-qcow2-linux-c9381e185fdcf86e9d7966d638c933894f87cdd7.tar.gz kernel-qcow2-linux-c9381e185fdcf86e9d7966d638c933894f87cdd7.tar.xz kernel-qcow2-linux-c9381e185fdcf86e9d7966d638c933894f87cdd7.zip |
Merge 5.0-rc4 into usb-next
We need the USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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); |