From: Daniel Borkmann Date: Sun, 15 May 2016 21:28:29 +0000 (+0200) Subject: net: also make sch_handle_egress() drop monitor ready X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7e2c3aea4398d079745b9faa2c17b6cbd010f221;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git net: also make sch_handle_egress() drop monitor ready Follow-up for 8a3a4c6e7b34 ("net: make sch_handle_ingress() drop monitor ready") to also make the egress side drop monitor ready. Also here only TC_ACT_SHOT is a clear indication that something went wrong. Hence don't provide false positives to drop monitors such as 'perf record -e skb:kfree_skb ...'. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index 12436d1312ca..904ff431d570 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3186,12 +3186,12 @@ sch_handle_egress(struct sk_buff *skb, int *ret, struct net_device *dev) case TC_ACT_SHOT: qdisc_qstats_cpu_drop(cl->q); *ret = NET_XMIT_DROP; - goto drop; + kfree_skb(skb); + return NULL; case TC_ACT_STOLEN: case TC_ACT_QUEUED: *ret = NET_XMIT_SUCCESS; -drop: - kfree_skb(skb); + consume_skb(skb); return NULL; case TC_ACT_REDIRECT: /* No need to push/pop skb's mac_header here on egress! */