mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 08:31:55 +00:00
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>
This commit is contained in:
parent
fd7dec25a1
commit
bf798657eb
@ -125,7 +125,7 @@ static inline enum nft_data_types nft_dreg_to_type(enum nft_registers reg)
|
||||
|
||||
static inline enum nft_registers nft_type_to_reg(enum nft_data_types type)
|
||||
{
|
||||
return type == NFT_DATA_VERDICT ? NFT_REG_VERDICT : NFT_REG_1;
|
||||
return type == NFT_DATA_VERDICT ? NFT_REG_VERDICT : NFT_REG_1 * NFT_REG_SIZE / NFT_REG32_SIZE;
|
||||
}
|
||||
|
||||
unsigned int nft_parse_register(const struct nlattr *attr);
|
||||
|
Loading…
Reference in New Issue
Block a user