[PATCH] ipt_limit fix for HZ=1000
commitb6e31b8e1e3b9fb29adcef9b1dde2b9865494c7c
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 9 Oct 2003 00:42:03 +0000 (8 17:42 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Thu, 9 Oct 2003 00:42:03 +0000 (8 17:42 -0700)
tree80f21e202258f53d71ae910ecbd87f3564663d90
parent9c0451e5d0cdba16e952c8975102054450d031a9
[PATCH] ipt_limit fix for HZ=1000

The range that the iptables limit extension can specify depends on HZ.
This means that rules which worked i386 2.4 (100 HZ) won't work on
2.6.

The solution is to adjust the precision based on the HZ value (keeping
the range of possible values the same).  For extra geek cred, this is
done by calculating a power-of-two constant below the maximum
multiplication factor, which gcc then turns into a simple shift.
net/ipv4/netfilter/ipt_limit.c