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: c12b395a46
("gre: Support GRE over IPv6")
Cc: Dmitry Kozlov <xeb@mail.ru>
Signed-off-by: Yuri Chislov <yuri.chislov@gmail.com>
Tested-by: Yuri Chislov <yuri.chislov@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
20ea60ca99
Коммит
be6572fdb1
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче