]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: netem: correct the parent's backlog when corrupted packet was dropped
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 18 Oct 2019 16:16:58 +0000 (09:16 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
BugLink: https://bugs.launchpad.net/bugs/1863019
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/sched/sch_netem.c

index 991a3b9fdb9b4e5b75eb0a45e9b8bb44b45dbb51..451eaa611c0b3e2bdc73aff4c11285642a3a0cd4 100644 (file)
@@ -604,6 +604,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;
 }