Skip to content

Commit e0ad032

Browse files
Jakub Kicinskidavem330
authored andcommitted
net: netem: correct the parent's backlog when corrupted packet was dropped
If packet corruption failed we jump to finish_segs and return NET_XMIT_SUCCESS. Seeing success will make the parent qdisc increment its backlog, that's incorrect - we need to return NET_XMIT_DROP. Fixes: 6071bd1 ("netem: Segment GSO packets on enqueue") Signed-off-by: Jakub Kicinski <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a7fa12d commit e0ad032

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/sched/sch_netem.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch,
616616
}
617617
/* Parent qdiscs accounted for 1 skb of size @prev_len */
618618
qdisc_tree_reduce_backlog(sch, -(nb - 1), -(len - prev_len));
619+
} else if (!skb) {
620+
return NET_XMIT_DROP;
619621
}
620622
return NET_XMIT_SUCCESS;
621623
}

0 commit comments

Comments
 (0)