b855d416dc
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> |
||
---|---|---|
.. | ||
ipv4 | ||
ipv6 | ||
nf_conntrack_acct.h | ||
nf_conntrack_core.h | ||
nf_conntrack_ecache.h | ||
nf_conntrack_expect.h | ||
nf_conntrack_extend.h | ||
nf_conntrack_helper.h | ||
nf_conntrack_l3proto.h | ||
nf_conntrack_l4proto.h | ||
nf_conntrack_labels.h | ||
nf_conntrack_seqadj.h | ||
nf_conntrack_synproxy.h | ||
nf_conntrack_timeout.h | ||
nf_conntrack_timestamp.h | ||
nf_conntrack_tuple.h | ||
nf_conntrack_zones.h | ||
nf_conntrack.h | ||
nf_log.h | ||
nf_nat_core.h | ||
nf_nat_helper.h | ||
nf_nat_l3proto.h | ||
nf_nat_l4proto.h | ||
nf_nat.h | ||
nf_queue.h | ||
nf_tables_core.h | ||
nf_tables_ipv4.h | ||
nf_tables_ipv6.h | ||
nf_tables.h | ||
nfnetlink_log.h | ||
nfnetlink_queue.h | ||
nft_reject.h | ||
xt_log.h | ||
xt_rateest.h |