diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-10-18 09:16:58 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-27 14:46:50 +0100 |
commit | b630744138cd00215befad571428b38b4b9f219d (patch) | |
tree | be854863c48f09b74dff767aeb99fe4892b8fbd5 /net/sched | |
parent | e0f8a42943c46030a40737a02e871186968f0123 (diff) | |
download | linux-stable-b630744138cd00215befad571428b38b4b9f219d.tar.gz linux-stable-b630744138cd00215befad571428b38b4b9f219d.tar.bz2 linux-stable-b630744138cd00215befad571428b38b4b9f219d.zip |
net: netem: correct the parent's backlog when corrupted packet was dropped
[ Upstream commit e0ad032e144731a5928f2d75e91c2064ba1a764c ]
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: 6071bd1aa13e ("netem: Segment GSO packets on enqueue")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/sch_netem.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 64c3cfa35736..328b043edf07 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -603,6 +603,8 @@ finish_segs: } /* Parent qdiscs accounted for 1 skb of size @prev_len */ qdisc_tree_reduce_backlog(sch, -(nb - 1), -(len - prev_len)); + } else if (!skb) { + return NET_XMIT_DROP; } return NET_XMIT_SUCCESS; } |