提交 7e2c3aea 编写于 作者: D Daniel Borkmann 提交者: David S. Miller

net: also make sch_handle_egress() drop monitor ready

Follow-up for 8a3a4c6e ("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: NDaniel Borkmann <daniel@iogearbox.net>
Acked-by: NAlexei Starovoitov <ast@kernel.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 15db6e0d
...@@ -3186,12 +3186,12 @@ sch_handle_egress(struct sk_buff *skb, int *ret, struct net_device *dev) ...@@ -3186,12 +3186,12 @@ sch_handle_egress(struct sk_buff *skb, int *ret, struct net_device *dev)
case TC_ACT_SHOT: case TC_ACT_SHOT:
qdisc_qstats_cpu_drop(cl->q); qdisc_qstats_cpu_drop(cl->q);
*ret = NET_XMIT_DROP; *ret = NET_XMIT_DROP;
goto drop; kfree_skb(skb);
return NULL;
case TC_ACT_STOLEN: case TC_ACT_STOLEN:
case TC_ACT_QUEUED: case TC_ACT_QUEUED:
*ret = NET_XMIT_SUCCESS; *ret = NET_XMIT_SUCCESS;
drop: consume_skb(skb);
kfree_skb(skb);
return NULL; return NULL;
case TC_ACT_REDIRECT: case TC_ACT_REDIRECT:
/* No need to push/pop skb's mac_header here on egress! */ /* No need to push/pop skb's mac_header here on egress! */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册