Commit d1b5b80d authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

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: 836382dc ("netfilter: nf_tables: add last expression")
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 6ac4bac4
...@@ -37,7 +37,7 @@ static int nft_last_init(const struct nft_ctx *ctx, const struct nft_expr *expr, ...@@ -37,7 +37,7 @@ static int nft_last_init(const struct nft_ctx *ctx, const struct nft_expr *expr,
if (err < 0) if (err < 0)
return err; return err;
priv->last_jiffies = jiffies + (unsigned long)last_jiffies; priv->last_jiffies = jiffies - (unsigned long)last_jiffies;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment