Skip to content

Commit

Permalink
ARM: net: add support for BPF_ANC | SKF_AD_PKTTYPE in ARM JIT.
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Schichan <nschichan@freebox.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nicolas Schichan authored and David S. Miller committed Jul 27, 2015
1 parent e11f40b commit 1447f93
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions arch/arm/net/bpf_jit_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,17 @@ static int build_body(struct jit_ctx *ctx)
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,
Expand Down

0 comments on commit 1447f93

Please sign in to comment.