summaryrefslogtreecommitdiff
path: root/net/sched
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2016-11-26 03:28:06 +0300
committerDavid S. Miller <davem@davemloft.net>2016-11-28 04:38:47 +0300
commitc491680f8f489926eebfdf2cd006767fc8bdaa49 (patch)
treef177ead97857daa2b63912240f2ef2c88e94085e /net/sched
parent55556dd59dfc49e9429b058cf7138a6726c949c7 (diff)
downloadlinux-c491680f8f489926eebfdf2cd006767fc8bdaa49.tar.xz
bpf: reuse dev_is_mac_header_xmit for redirect
Commit dcf800344a91 ("net/sched: act_mirred: Refactor detection whether dev needs xmit at mac header") added dev_is_mac_header_xmit(); since it's also useful elsewhere, move it to if_arp.h and reuse it for BPF. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/act_mirred.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index b2d417b8f46c..1af7baa732a3 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -21,6 +21,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/gfp.h>
+#include <linux/if_arp.h>
#include <net/net_namespace.h>
#include <net/netlink.h>
#include <net/pkt_sched.h>
@@ -73,20 +74,6 @@ static const struct nla_policy mirred_policy[TCA_MIRRED_MAX + 1] = {
static unsigned int mirred_net_id;
static struct tc_action_ops act_mirred_ops;
-static bool dev_is_mac_header_xmit(const struct net_device *dev)
-{
- switch (dev->type) {
- case ARPHRD_TUNNEL:
- case ARPHRD_TUNNEL6:
- case ARPHRD_SIT:
- case ARPHRD_IPGRE:
- case ARPHRD_VOID:
- case ARPHRD_NONE:
- return false;
- }
- return true;
-}
-
static int tcf_mirred_init(struct net *net, struct nlattr *nla,
struct nlattr *est, struct tc_action **a, int ovr,
int bind)