diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-07-05 20:14:21 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-07-06 14:15:13 +0200 |
commit | d1b5b80da7058883758df2b5b7f506d4d4f9a5fa (patch) | |
tree | a7c84f4408e02290db52edb124f54746ffe307b4 /net/netfilter | |
parent | 6ac4bac4ce48604cf0f4b04d61884552520ca55e (diff) | |
download | linux-stable-d1b5b80da7058883758df2b5b7f506d4d4f9a5fa.tar.gz linux-stable-d1b5b80da7058883758df2b5b7f506d4d4f9a5fa.tar.bz2 linux-stable-d1b5b80da7058883758df2b5b7f506d4d4f9a5fa.zip |
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>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nft_last.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nft_last.c b/net/netfilter/nft_last.c index bbb352b64c73..8088b99f2ee3 100644 --- a/net/netfilter/nft_last.c +++ b/net/netfilter/nft_last.c @@ -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; |