ChangeSet 1.2336, 2005/03/31 22:35:09-08:00, [EMAIL PROTECTED]

        [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 <[EMAIL PROTECTED]>
        Signed-off-by: Harald Welte <[EMAIL PROTECTED]>
        Signed-off-by: David S. Miller <[EMAIL PROTECTED]>



 ipt_hashlimit.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)


diff -Nru a/net/ipv4/netfilter/ipt_hashlimit.c 
b/net/ipv4/netfilter/ipt_hashlimit.c
--- a/net/ipv4/netfilter/ipt_hashlimit.c        2005-04-01 09:11:55 -08:00
+++ b/net/ipv4/netfilter/ipt_hashlimit.c        2005-04-01 09:11:55 -08:00
@@ -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 <[EMAIL PROTECTED]>");
 MODULE_DESCRIPTION("iptables match for limiting per hash-bucket");
@@ -230,7 +228,7 @@
        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 @@
        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 @@
                        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 @@
        }
 
        /* 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) {
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to