Skip to content

Commit

Permalink
sch_cake: Use tc_skb_protocol for getting packet protocol
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tohojo committed Apr 2, 2019
1 parent 6bf7d06 commit 9fba602
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sch_cake.c
Expand Up @@ -1644,7 +1644,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)
Expand Down

0 comments on commit 9fba602

Please sign in to comment.