netfilter: nft_dynset: fix element timeout for HZ != 1000
authorAnders K. Pedersen <akp@cohaesio.com>
Sun, 9 Oct 2016 13:49:02 +0000 (13:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Nov 2016 08:54:54 +0000 (09:54 +0100)
commit1ba7fafae3c2c1bcafa838a36db0fd358edb18af
treef81a6a4030f79b504b8bf36d9607bc5b4c9685b0
parent698a8dddb8a55250e0d6c2c87da08da2314cbdd3
netfilter: nft_dynset: fix element timeout for HZ != 1000

commit a8b1e36d0d1d6f51490e7adce35367ed6adb10e7 upstream.

With HZ=100 element timeout in dynamic sets (i.e. flow tables) is 10 times
higher than configured.

Add proper conversion to/from jiffies, when interacting with userspace.

I tested this on Linux 4.8.1, and it applies cleanly to current nf and
nf-next trees.

Fixes: 22fe54d5fefc ("netfilter: nf_tables: add support for dynamic set updates")
Signed-off-by: Anders K. Pedersen <akp@cohaesio.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nft_dynset.c