kernel-ark/include/net/netfilter
Patrick McHardy b855d416dc netfilter: nf_tables: fix nft_cmp_fast failure on big endian for size < 4
nft_cmp_fast is used for equality comparisions of size <= 4. For
comparisions of size < 4 byte a mask is calculated that is applied to
both the data from userspace (during initialization) and the register
value (during runtime). Both values are stored using (in effect) memcpy
to a memory area that is then interpreted as u32 by nft_cmp_fast.

This works fine on little endian since smaller types have the same base
address, however on big endian this is not true and the smaller types
are interpreted as a big number with trailing zero bytes.

The mask therefore must not include the lower bytes, but the higher bytes
on big endian. Add a helper function that does a cpu_to_le32 to switch
the bytes on big endian. Since we're dealing with a mask of just consequitive
bits, this works out fine.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2014-04-14 10:38:02 +02:00
..
ipv4 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nftables 2014-01-06 13:29:30 -05:00
ipv6 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nftables 2014-01-06 13:29:30 -05:00
nf_conntrack_acct.h netfilter: introduce nf_conn_acct structure 2013-11-03 21:48:49 +01:00
nf_conntrack_core.h netfilter: conntrack: remove central spinlock nf_conntrack_lock 2014-03-07 11:41:13 +01:00
nf_conntrack_ecache.h
nf_conntrack_expect.h
nf_conntrack_extend.h netfilter: nf_conntrack: reserve two bytes for nf_ct_ext->len 2014-04-03 23:52:31 +02:00
nf_conntrack_helper.h
nf_conntrack_l3proto.h netfilter: nf_conntrack: remove dead code 2014-01-03 23:41:37 +01:00
nf_conntrack_l4proto.h
nf_conntrack_labels.h netfilter: nft_ct: labels get support 2014-02-19 11:41:25 +01:00
nf_conntrack_seqadj.h
nf_conntrack_synproxy.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-10-01 17:06:14 -04:00
nf_conntrack_timeout.h
nf_conntrack_timestamp.h
nf_conntrack_tuple.h
nf_conntrack_zones.h
nf_conntrack.h netfilter: conntrack: spinlock per cpu to protect special lists. 2014-03-07 11:40:38 +01:00
nf_log.h
nf_nat_core.h
nf_nat_helper.h
nf_nat_l3proto.h
nf_nat_l4proto.h
nf_nat.h netfilter: nf_nat: move alloc_null_binding to nf_nat_core.c 2013-10-14 11:29:39 +02:00
nf_queue.h netfilter: xt_NFQUEUE: separate reusable code 2013-12-07 23:20:45 +01:00
nf_tables_core.h netfilter: nf_tables: fix nft_cmp_fast failure on big endian for size < 4 2014-04-14 10:38:02 +02:00
nf_tables_ipv4.h netfilter: nft_meta: add l4proto support 2014-01-07 23:57:31 +01:00
nf_tables_ipv6.h netfilter: nft_meta: add l4proto support 2014-01-07 23:57:31 +01:00
nf_tables.h netfilter: nf_tables: restore context for expression destructors 2014-03-08 12:35:17 +01:00
nfnetlink_log.h
nfnetlink_queue.h
nft_reject.h netfilter: nf_tables: add reject module for NFPROTO_INET 2014-02-06 09:44:18 +01:00
xt_log.h
xt_rateest.h