Pablo reports set test fails with HZ=250, as it lists "324ms" instead
of "321". This is because of rounding errors that occur when converting
from user-side millisecond scale to kernel-internal jiffies one.
use 100ms for now to avoid this error.
Alternatives would be to store use-provided value in kernel or to avoid
the conversions; this would require a change to make timeout independent from
jiffies on kernel side.
Reported-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
add set x y { type ipv4_addr; size 128; timeout 30s; }
add chain x test
add rule x test set update ip saddr timeout 1d2h3m4s5ms @y
-add rule x test set update ip daddr timeout 321ms @y"
+add rule x test set update ip daddr timeout 100ms @y"
set -e
$NFT -f - <<< $RULESET
$NFT list chain x test | grep -q 'update @y { ip saddr timeout 1d2h3m4s5ms }'
-$NFT list chain x test | grep -q 'update @y { ip daddr timeout 321ms }'
+$NFT list chain x test | grep -q 'update @y { ip daddr timeout 100ms }'