diff options
author | Markos Chandras <markos.chandras@imgtec.com> | 2014-06-23 10:38:58 +0100 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-06-26 10:48:22 +0100 |
commit | b4fe0ec86dae91abfa9f932cd0e2e9d50e336c8b (patch) | |
tree | a40109b4861da4da8fff62c37bac63907c2e1600 /fs/ext4 | |
parent | 95782bf434437b3292f5cb9ce21b53bdbc1beda1 (diff) | |
download | linux-b4fe0ec86dae91abfa9f932cd0e2e9d50e336c8b.tar.bz2 |
MIPS: bpf: Fix PKT_TYPE case for big-endian cores
The skb->pkt_type field is defined as follows:
u8 pkt_type:3,
fclone:2,
ipvs_property:1,
peeked:1,
nf_trace:1
resulting to the following layout in big-endian systems
[pkt_type][fclone][ipvs_propery][peeked][nf_trace]
^ ^
| |
LSB MSB
As a result, the existing code did not work because it was trying to
match pkt_type == 7 whereas in reality it is 7<<5 on big-endian
systems.
This has been fixed in the interpreter in
0dcceabb0c1bf2d4c12a748df9933fad303072a7
"net: filter: fix SKF_AD_PKTTYPE extension on big-endian"
The fix is to look for 7<<5 on big-endian systems for the pkt_type
field, and shift by 5 so the packet type will be at the lower 3 bits
of the A register.
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Daniel Borkmann <dborkman@redhat.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7132/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'fs/ext4')
0 files changed, 0 insertions, 0 deletions