diff options
author | Tobias Klauser <tklauser@nuerscht.ch> | 2005-03-31 06:35:09 -0800 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-03-31 06:35:09 -0800 |
commit | e6eecb695ea9744c90c69c1149fd526099b05afa (patch) | |
tree | 72b9406c7c67408c773b7353dbcae8b66fd1eabe | |
parent | faf3034ed66a3400cc90574e9e8022b5f7609bfd (diff) | |
download | history-e6eecb695ea9744c90c69c1149fd526099b05afa.tar.gz |
[NETFILTER]: ipt_hashlimit: Remove custom msecs_to_jiffies() macro
Replace the MS2JIFFIES() macro with the msecs_to_jiffies() function provided in
jiffies.h. The current macro is incorrect because HZ can have different values
on different architectures.
Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/netfilter/ipt_hashlimit.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/net/ipv4/netfilter/ipt_hashlimit.c b/net/ipv4/netfilter/ipt_hashlimit.c index a727913fd83d82..f1937190cd771c 100644 --- a/net/ipv4/netfilter/ipt_hashlimit.c +++ b/net/ipv4/netfilter/ipt_hashlimit.c @@ -42,8 +42,6 @@ /* FIXME: this is just for IP_NF_ASSERRT */ #include <linux/netfilter_ipv4/ip_conntrack.h> -#define MS2JIFFIES(x) ((x*HZ)/1000) - MODULE_LICENSE("GPL"); MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>"); MODULE_DESCRIPTION("iptables match for limiting per hash-bucket"); @@ -230,7 +228,7 @@ static int htable_create(struct ipt_hashlimit_info *minfo) hinfo->pde->data = hinfo; init_timer(&hinfo->timer); - hinfo->timer.expires = jiffies + MS2JIFFIES(hinfo->cfg.gc_interval); + hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval); hinfo->timer.data = (unsigned long )hinfo; hinfo->timer.function = htable_gc; add_timer(&hinfo->timer); @@ -281,7 +279,7 @@ static void htable_gc(unsigned long htlong) htable_selective_cleanup(ht, select_gc); /* re-add the timer accordingly */ - ht->timer.expires = jiffies + MS2JIFFIES(ht->cfg.gc_interval); + ht->timer.expires = jiffies + msecs_to_jiffies(ht->cfg.gc_interval); add_timer(&ht->timer); } @@ -475,7 +473,7 @@ hashlimit_match(const struct sk_buff *skb, return 0; } - dh->expires = jiffies + MS2JIFFIES(hinfo->cfg.expire); + dh->expires = jiffies + msecs_to_jiffies(hinfo->cfg.expire); dh->rateinfo.prev = jiffies; dh->rateinfo.credit = user2credits(hinfo->cfg.avg * @@ -489,7 +487,7 @@ hashlimit_match(const struct sk_buff *skb, } /* update expiration timeout */ - dh->expires = now + MS2JIFFIES(hinfo->cfg.expire); + dh->expires = now + msecs_to_jiffies(hinfo->cfg.expire); rateinfo_recalc(dh, now); if (dh->rateinfo.credit >= dh->rateinfo.cost) { |