mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
netfilter: nf_tables: add NFT_CHAIN_POLICY_UNSET and use it
Default policy is defined as a unsigned 8-bit field, do not use a negative value to leave it unset, use this new NFT_CHAIN_POLICY_UNSET instead. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
864668bfc3
commit
ad652f3811
2 changed files with 3 additions and 1 deletions
|
@ -889,6 +889,8 @@ enum nft_chain_flags {
|
|||
NFT_CHAIN_HW_OFFLOAD = 0x2,
|
||||
};
|
||||
|
||||
#define NFT_CHAIN_POLICY_UNSET U8_MAX
|
||||
|
||||
/**
|
||||
* struct nft_chain - nf_tables chain
|
||||
*
|
||||
|
|
|
@ -1715,7 +1715,7 @@ static int nf_tables_addchain(struct nft_ctx *ctx, u8 family, u8 genmask,
|
|||
goto err2;
|
||||
}
|
||||
|
||||
nft_trans_chain_policy(trans) = -1;
|
||||
nft_trans_chain_policy(trans) = NFT_CHAIN_POLICY_UNSET;
|
||||
if (nft_is_base_chain(chain))
|
||||
nft_trans_chain_policy(trans) = policy;
|
||||
|
||||
|
|
Loading…
Reference in a new issue