Commit be6572fd authored by Yuri Chislov's avatar Yuri Chislov Committed by David S. Miller

ipv6: gre: fix wrong skb->protocol in WCCP

When using GRE redirection in WCCP, it sets the wrong skb->protocol,
that is, ETH_P_IP instead of ETH_P_IPV6 for the encapuslated traffic.

Fixes: c12b395a ("gre: Support GRE over IPv6")
Cc: Dmitry Kozlov <xeb@mail.ru>
Signed-off-by: default avatarYuri Chislov <yuri.chislov@gmail.com>
Tested-by: default avatarYuri Chislov <yuri.chislov@gmail.com>
Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 20ea60ca
...@@ -502,11 +502,11 @@ static int ip6gre_rcv(struct sk_buff *skb) ...@@ -502,11 +502,11 @@ static int ip6gre_rcv(struct sk_buff *skb)
skb->protocol = gre_proto; skb->protocol = gre_proto;
/* WCCP version 1 and 2 protocol decoding. /* WCCP version 1 and 2 protocol decoding.
* - Change protocol to IP * - Change protocol to IPv6
* - When dealing with WCCPv2, Skip extra 4 bytes in GRE header * - When dealing with WCCPv2, Skip extra 4 bytes in GRE header
*/ */
if (flags == 0 && gre_proto == htons(ETH_P_WCCP)) { if (flags == 0 && gre_proto == htons(ETH_P_WCCP)) {
skb->protocol = htons(ETH_P_IP); skb->protocol = htons(ETH_P_IPV6);
if ((*(h + offset) & 0xF0) != 0x40) if ((*(h + offset) & 0xF0) != 0x40)
offset += 4; offset += 4;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment