0220-net-sched-add-skb_at_tc_ingress-helper.patch 1016 B

12345678910111213141516171819202122232425262728293031
  1. From 4395275fcbb80f1e312d75b20a68aabcb7c0dc74 Mon Sep 17 00:00:00 2001
  2. From: Daniel Borkmann <daniel@iogearbox.net>
  3. Date: Thu, 7 Jan 2016 15:50:22 +0100
  4. Subject: [PATCH] net, sched: add skb_at_tc_ingress helper
  5. Add a skb_at_tc_ingress() as this will be needed elsewhere as well and
  6. can hide the ugly ifdef.
  7. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  8. Acked-by: Alexei Starovoitov <ast@kernel.org>
  9. Signed-off-by: David S. Miller <davem@davemloft.net>
  10. ---
  11. net/sched/cls_bpf.c | 6 +-----
  12. 1 file changed, 1 insertion(+), 5 deletions(-)
  13. --- a/net/sched/cls_bpf.c
  14. +++ b/net/sched/cls_bpf.c
  15. @@ -79,12 +79,8 @@ static int cls_bpf_classify(struct sk_bu
  16. struct tcf_result *res)
  17. {
  18. struct cls_bpf_head *head = rcu_dereference_bh(tp->root);
  19. + bool at_ingress = skb_at_tc_ingress(skb);
  20. struct cls_bpf_prog *prog;
  21. -#ifdef CONFIG_NET_CLS_ACT
  22. - bool at_ingress = G_TC_AT(skb->tc_verd) & AT_INGRESS;
  23. -#else
  24. - bool at_ingress = false;
  25. -#endif
  26. int ret = -1;
  27. if (unlikely(!skb_mac_header_was_set(skb)))