Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: nf_tables: Use 32 bit addressing register from nft_type_to_reg()

nft_type_to_reg() needs to return the register in the new 32 bit addressing,
otherwise we hit EINVAL when using mappings.

Fixes: 49499c3 ("netfilter: nf_tables: switch registers to 32 bit addressing")
Reported-by: Andreas Schultz <aschultz@tpip.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

+1 -1
+1 -1
include/net/netfilter/nf_tables.h
··· 125 125 126 126 static inline enum nft_registers nft_type_to_reg(enum nft_data_types type) 127 127 { 128 - return type == NFT_DATA_VERDICT ? NFT_REG_VERDICT : NFT_REG_1; 128 + return type == NFT_DATA_VERDICT ? NFT_REG_VERDICT : NFT_REG_1 * NFT_REG_SIZE / NFT_REG32_SIZE; 129 129 } 130 130 131 131 unsigned int nft_parse_register(const struct nlattr *attr);