net: filter: constify detection of pkt_type_offset
authorHannes Frederic Sowa <[email protected]>
Fri, 12 Sep 2014 12:04:43 +0000 (14:04 +0200)
committerDavid S. Miller <[email protected]>
Sat, 13 Sep 2014 21:07:21 +0000 (17:07 -0400)
commit233577a22089facf5271ab5e845b2262047c971f
treec93ec43dbf3adb316b3af67a3d315984b3cc5f10
parentac7a04c33dd7f8e429df4b929ba3a3e8e729cc89
net: filter: constify detection of pkt_type_offset

Currently we have 2 pkt_type_offset functions doing the same thing and
spread across the architecture files. Remove those and replace them
with a PKT_TYPE_OFFSET macro helper which gets the constant value from a
zero sized sk_buff member right in front of the bitfield with offsetof.
This new offset marker does not change size of struct sk_buff.

Cc: Eric Dumazet <[email protected]>
Cc: Markos Chandras <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Signed-off-by: Denis Kirjanov <[email protected]>
Signed-off-by: Hannes Frederic Sowa <[email protected]>
Acked-by: Alexei Starovoitov <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
arch/mips/net/bpf_jit.c
arch/s390/net/bpf_jit_comp.c
include/linux/skbuff.h
net/core/filter.c