]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
fuzzy: remove unneeded spinlock
authorJan Engelhardt <jengelh@medozas.de>
Sun, 31 Aug 2008 20:48:15 +0000 (16:48 -0400)
committerJan Engelhardt <jengelh@medozas.de>
Mon, 1 Sep 2008 19:22:22 +0000 (15:22 -0400)
extensions/xt_fuzzy.c

index 27c6ca4ab09a59b33a917cdb655d3608887cd153..cbad2941508a74e67f09bcca005c6fb053740992 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/random.h>
-#include <linux/spinlock.h>
 #include <net/tcp.h>
 #include <linux/netfilter/x_tables.h>
 #include "xt_fuzzy.h"
@@ -35,8 +34,6 @@
 #define PAR_LOW                1/100
 #define PAR_HIGH       1
 
-static spinlock_t fuzzy_lock = SPIN_LOCK_UNLOCKED;
-
 MODULE_AUTHOR("Hime Aguiar e Oliveira Junior <hime@engineer.com>");
 MODULE_DESCRIPTION("IP tables Fuzzy Logic Controller match module");
 MODULE_LICENSE("GPL");
@@ -74,9 +71,6 @@ fuzzy_mt(const struct sk_buff *skb, const struct net_device *in,
        unsigned long amount;
        uint8_t howhigh, howlow, random_number;
 
-
-       spin_lock_bh(&fuzzy_lock); /* Rise the lock */
-
        info->bytes_total += skb->len;
        ++info->packets_total;
 
@@ -121,9 +115,6 @@ fuzzy_mt(const struct sk_buff *skb, const struct net_device *in,
 
        }
 
-       spin_unlock_bh(&fuzzy_lock); /* Release the lock */
-
-
        if (info->acceptance_rate < 100)
        {
                get_random_bytes((void *)(&random_number), 1);