Skip to content

Commit db6d857

Browse files
committed
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 <[email protected]>
1 parent 0d9932b commit db6d857

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netfilter/nft_quota.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static void nft_quota_eval(const struct nft_expr *expr,
3333
{
3434
struct nft_quota *priv = nft_expr_priv(expr);
3535

36-
if (nft_quota(priv, pkt) < 0 && !priv->invert)
36+
if ((nft_quota(priv, pkt) < 0) ^ priv->invert)
3737
regs->verdict.code = NFT_BREAK;
3838
}
3939

0 commit comments

Comments
 (0)