mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
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: 836382dc24 ("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…
Reference in New Issue
Block a user