mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 14:41:39 +00:00
netfilter: nf_tables_offload: fix always true policy is unset check
New smatch warnings:
net/netfilter/nf_tables_offload.c:316 nft_flow_offload_chain() warn: always true condition '(policy != -1) => (0-255 != (-1))'
Reported-by: kbuild test robot <lkp@intel.com>
Fixes: c9626a2cbd
("netfilter: nf_tables: add hardware offload support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
ad652f3811
commit
ff175d0b0e
@ -313,7 +313,7 @@ static int nft_flow_offload_chain(struct nft_chain *chain,
|
||||
policy = ppolicy ? *ppolicy : basechain->policy;
|
||||
|
||||
/* Only default policy to accept is supported for now. */
|
||||
if (cmd == FLOW_BLOCK_BIND && policy != -1 && policy != NF_ACCEPT)
|
||||
if (cmd == FLOW_BLOCK_BIND && policy == NF_DROP)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (dev->netdev_ops->ndo_setup_tc)
|
||||
|
Loading…
Reference in New Issue
Block a user