diff options
author | Nicolas Schichan <nschichan@freebox.fr> | 2015-07-27 15:06:49 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-27 14:57:40 -0700 |
commit | 1447f93f22add339ee63d1a7015309d9fbfa47e8 (patch) | |
tree | b26259c32c5b1c827e817fd1e10a8e00f961ab70 /arch/arm/net | |
parent | e11f40b9352f75d924cb216abcc5413b38d9288b (diff) | |
download | linux-1447f93f22add339ee63d1a7015309d9fbfa47e8.tar.bz2 |
ARM: net: add support for BPF_ANC | SKF_AD_PKTTYPE in ARM JIT.
Signed-off-by: Nicolas Schichan <nschichan@freebox.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/arm/net')
-rw-r--r-- | arch/arm/net/bpf_jit_32.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index c011e2296cb1..6ff248ca36d9 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c @@ -895,6 +895,17 @@ b_epilogue: OP_IMM3(ARM_AND, r_A, r_A, 0x1, ctx); } break; + case BPF_ANC | SKF_AD_PKTTYPE: + ctx->seen |= SEEN_SKB; + BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, + __pkt_type_offset[0]) != 1); + off = PKT_TYPE_OFFSET(); + emit(ARM_LDRB_I(r_A, r_skb, off), ctx); + emit(ARM_AND_I(r_A, r_A, PKT_TYPE_MAX), ctx); +#ifdef __BIG_ENDIAN_BITFIELD + emit(ARM_LSR_I(r_A, r_A, 5), ctx); +#endif + break; case BPF_ANC | SKF_AD_QUEUE: ctx->seen |= SEEN_SKB; BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, |