mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 11:03:43 +02:00
netfilter: nft_quota: fix overquota logic
Use xor to decide to break further rule evaluation or not, since the existing logic doesn't achieve the expected inversion. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
0d9932b287
commit
db6d857b81
|
|
@ -33,7 +33,7 @@ static void nft_quota_eval(const struct nft_expr *expr,
|
|||
{
|
||||
struct nft_quota *priv = nft_expr_priv(expr);
|
||||
|
||||
if (nft_quota(priv, pkt) < 0 && !priv->invert)
|
||||
if ((nft_quota(priv, pkt) < 0) ^ priv->invert)
|
||||
regs->verdict.code = NFT_BREAK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user