]> git.baikalelectronics.ru Git - kernel.git/commit
net: filter: fix SKF_AD_PKTTYPE extension on big-endian
authorAlexei Starovoitov <ast@plumgrid.com>
Thu, 5 Jun 2014 21:39:36 +0000 (14:39 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Jun 2014 22:40:38 +0000 (15:40 -0700)
commitaff15ff4e5219feb601c285d96fb7df9150b164c
tree42b5b392bddc1c0add13fd61b3ab91e5c32b08ac
parent1b00220e57f1f402825029008fff8feabbb43712
net: filter: fix SKF_AD_PKTTYPE extension on big-endian

BPF classic->internal converter broke SKF_AD_PKTTYPE extension, since
pkt_type_offset() was failing to find skb->pkt_type field which is defined as:
__u8 pkt_type:3,
     fclone:2,
     ipvs_property:1,
     peeked:1,
     nf_trace:1;

Fix it by searching for 3 most significant bits and shift them by 5 at run-time

Fixes: 54196fba2423 ("net: filter: rework/optimize internal BPF interpreter's instruction set")
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Tested-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/filter.c