From: "Paweł Sikora" <pluto@agmk.net>
To: Netfilter Development Mailinglist
<netfilter-devel@lists.netfilter.org>,
Patrick McHardy <kaber@trash.net>
Subject: [2.6.13] u32 fix.
Date: Fri, 16 Sep 2005 15:48:38 +0200 [thread overview]
Message-ID: <200509161548.38464.pluto@agmk.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 229 bytes --]
Hi,
Could someone check and commit this lockhelp-fix?
Regards,
Paweł.
--
The only thing necessary for the triumph of evil
is for good men to do nothing.
- Edmund Burke
[-- Attachment #2: u32-2.6.13.patch --]
[-- Type: text/x-diff, Size: 1513 bytes --]
Index: patchlets/u32/linux-2.6/net/ipv4/netfilter/ipt_u32.c
===================================================================
--- patchlets/u32/linux-2.6/net/ipv4/netfilter/ipt_u32.c (revision 4262)
+++ patchlets/u32/linux-2.6/net/ipv4/netfilter/ipt_u32.c (working copy)
@@ -105,7 +105,6 @@
#include <linux/netfilter_ipv4/ipt_u32.h>
#include <linux/netfilter_ipv4/ip_tables.h>
-#include <linux/netfilter_ipv4/lockhelp.h>
/* #include <asm-i386/timex.h> for timing */
@@ -115,7 +114,7 @@
/* This is slow, but it's simple. --RR */
static char u32_buffer[65536];
-static DECLARE_LOCK(u32_lock);
+static DEFINE_SPINLOCK(u32_lock);
static int
match(const struct sk_buff *skb,
@@ -136,7 +135,7 @@
u_int32_t AttPos;
- LOCK_BH(&u32_lock);
+ spin_lock_bh(&u32_lock);
head = skb_header_pointer(skb, 0, skb->len, u32_buffer);
BUG_ON(head == NULL);
@@ -148,7 +147,7 @@
AttPos = 0;
pos = data->tests[testind].location[0].number;
if (AttPos + pos + 3 > skb->len || AttPos + pos < 0){
- UNLOCK_BH(&u32_lock);
+ spin_unlock_bh(&u32_lock);
return 0;
}
val = (base[pos]<<24) + (base[pos+1]<<16) +
@@ -190,13 +189,13 @@
/* cycles2 = get_cycles();
printk("failed %d in %d cycles\n", testind,
cycles2-cycles1); */
- UNLOCK_BH(&u32_lock);
+ spin_unlock_bh(&u32_lock);
return 0;
}
}
/* cycles2 = get_cycles();
printk("succeeded in %d cycles\n", cycles2-cycles1); */
- UNLOCK_BH(&u32_lock);
+ spin_unlock_bh(&u32_lock);
return 1;
}
next reply other threads:[~2005-09-16 13:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-16 13:48 Paweł Sikora [this message]
2005-09-16 14:14 ` [2.6.13] u32 fix Samir Bellabes
2005-09-20 23:08 ` Patrick McHardy
2005-09-21 14:10 ` Samir Bellabes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200509161548.38464.pluto@agmk.net \
--to=pluto@agmk.net \
--cc=kaber@trash.net \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.