From f5a692f4f68582dfd17161798d8dda9d9464a9e4 Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Thu, 18 Sep 2003 18:55:11 +0000 Subject: *** empty log message *** --- kernel/linux/net/bridge/netfilter/ebt_limit.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/kernel/linux/net/bridge/netfilter/ebt_limit.c b/kernel/linux/net/bridge/netfilter/ebt_limit.c index 5947e56..f130203 100644 --- a/kernel/linux/net/bridge/netfilter/ebt_limit.c +++ b/kernel/linux/net/bridge/netfilter/ebt_limit.c @@ -4,7 +4,7 @@ * Authors: * Tom Marshall * - * Mostly copied from netfilter's ipt_limit.c + * Mostly copied from netfilter's ipt_limit.c, see that file for explanation * * September, 2003 * @@ -17,30 +17,8 @@ #include #include -/* The algorithm used is the Simple Token Bucket Filter (TBF) - * see net/sched/sch_tbf.c in the linux source tree - */ - static spinlock_t limit_lock = SPIN_LOCK_UNLOCKED; -/* Rusty: This is my (non-mathematically-inclined) understanding of - this algorithm. The `average rate' in jiffies becomes your initial - amount of credit `credit' and the most credit you can ever have - `credit_cap'. The `peak rate' becomes the cost of passing the - test, `cost'. - - `prev' tracks the last packet hit: you gain one credit per jiffy. - If you get credit balance more than this, the extra credit is - discarded. Every time the match passes, you lose `cost' credits; - if you don't have that many, the test fails. - - See Alexey's formal explanation in net/sched/sch_tbf.c. - - To avoid underflow, we multiply by 128 (ie. you get 128 credits per - jiffy). Hence a cost of 2^32-1, means one pass per 32768 seconds - at 1024HZ (or one every 9 hours). A cost of 1 means 12800 passes - per second at 100HZ. */ - #define CREDITS_PER_JIFFY 128 static int ebt_limit_match(const struct sk_buff *skb, const struct net_device *in, -- cgit v1.2.3