sch_cake: Use tc_skb_protocol() helper for getting packet protocol
authorToke Høiland-Jørgensen <toke@redhat.com>
Thu, 4 Apr 2019 13:01:33 +0000 (15:01 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 Apr 2019 17:55:59 +0000 (10:55 -0700)
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@darbyshire-bryant.me.uk>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_cake.c

index acc9b9da985f81ffd9b485e082cf1781e6731ba2..a3b55e18df047e36bbceb0fe88cdb82f4a164f62 100644 (file)
@@ -1519,7 +1519,7 @@ static u8 cake_handle_diffserv(struct sk_buff *skb, u16 wash)
 {
        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)