Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -502,11 +502,11 @@ static int ip6gre_rcv(struct sk_buff *skb)

		skb->protocol = gre_proto;
		/* 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
		 */
		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)
				offset += 4;
		}