fuzzy: remove unneeded spinlock

This commit is contained in:
Jan Engelhardt
2008-08-31 16:48:15 -04:00
parent fd83fefad1
commit 003591fe6f

View 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);