netfilter: nft_last: incorrect arithmetics when restoring last used
Subtract the jiffies that have passed by to current jiffies to fix last used restoration. Fixes: 836382dc2471 ("netfilter: nf_tables: add last expression") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
6ac4bac4ce
commit
d1b5b80da7
@ -37,7 +37,7 @@ static int nft_last_init(const struct nft_ctx *ctx, const struct nft_expr *expr,
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
priv->last_jiffies = jiffies + (unsigned long)last_jiffies;
|
||||
priv->last_jiffies = jiffies - (unsigned long)last_jiffies;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user