[PATCH 4.19 20/96] sch_cake: Use tc_skb_protocol() helper for getting packet protocol

From: Greg Kroah-Hartman
Date: Wed Apr 24 2019 - 13:50:15 EST


From: Toke HÃiland-JÃrgensen <toke@xxxxxxxxxx>

[ Upstream commit b2100cc56fca8c51d28aa42a9f1fbcb2cf351996 ]

We shouldn't be using skb->protocol directly as that will miss cases with
hardware-accelerated VLAN tags. Use the helper instead to get the right
protocol number.

Reported-by: Kevin Darbyshire-Bryant <kevin@xxxxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Toke HÃiland-JÃrgensen <toke@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
net/sched/sch_cake.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -1526,7 +1526,7 @@ static u8 cake_handle_diffserv(struct sk
{
u8 dscp;

- switch (skb->protocol) {
+ switch (tc_skb_protocol(skb)) {
case htons(ETH_P_IP):
dscp = ipv4_get_dsfield(ip_hdr(skb)) >> 2;
if (wash && dscp)