From: Harald Welte <laforge@netfilter.org>
To: Joshua Kwan <joshk@triplehelix.org>
Cc: linux-kernel@vger.kernel.org,
Netfilter Development Mailinglist
<netfilter-devel@lists.netfilter.org>,
David Miller <davem@redhat.com>
Subject: Re: Linux 2.6.9-rc1
Date: Wed, 25 Aug 2004 22:32:06 +0200 [thread overview]
Message-ID: <20040825203206.GS5824@sunbeam.de.gnumonks.org> (raw)
In-Reply-To: <412CDFEE.1010505@triplehelix.org>
[-- Attachment #1: Type: text/plain, Size: 2606 bytes --]
On Wed, Aug 25, 2004 at 11:52:30AM -0700, Joshua Kwan wrote:
> Linus Torvalds wrote:
> >Harald Welte:
> ...
> > o [NETFILTER]: Make 'helper' list of ip_nat_core static
> ...
>
> I suspect that this changeset[1] somehow caused this to happen (many
> times) in dmesg:
>
> ASSERT net/ipv4/netfilter/ip_nat_helper.c:428 &ip_nat_lock writelocked
yes, indeed.
> It seems to be working properly (NATting two machines behind a local
> network to the Internet.)
The 'problem' is that we try to get a readlock while we're already
protected under a write lock.
Please see the following [quite trivial, but yet untested] patch:
--- linux-2.6.9-rc1/net/ipv4/netfilter/ip_nat_core.c 2004-08-25 22:22:36.450340504 +0200
+++ linux-2.6.9-rc1-find_helper/net/ipv4/netfilter/ip_nat_core.c 2004-08-25 22:28:37.668273271 +0200
@@ -635,7 +635,7 @@
/* If there's a helper, assign it; based on new tuple. */
if (!conntrack->master)
- info->helper = ip_nat_find_helper(&reply);
+ info->helper = __ip_nat_find_helper(&reply);
/* It's done. */
info->initialized |= (1 << HOOK2MANIP(hooknum));
--- linux-2.6.9-rc1/net/ipv4/netfilter/ip_nat_helper.c 2004-08-25 22:22:36.453340376 +0200
+++ linux-2.6.9-rc1-find_helper/net/ipv4/netfilter/ip_nat_helper.c 2004-08-25 22:27:47.880335112 +0200
@@ -421,12 +421,18 @@
}
struct ip_nat_helper *
+__ip_nat_find_helper(const struct ip_conntrack_tuple *tuple)
+{
+ return LIST_FIND(&helpers, helper_cmp, struct ip_nat_helper *, tuple);
+}
+
+struct ip_nat_helper *
ip_nat_find_helper(const struct ip_conntrack_tuple *tuple)
{
struct ip_nat_helper *h;
READ_LOCK(&ip_nat_lock);
- h = LIST_FIND(&helpers, helper_cmp, struct ip_nat_helper *, tuple);
+ h = __ip_nat_find_helper(tuple);
READ_UNLOCK(&ip_nat_lock);
return h;
--- linux-2.6.9-rc1/net/ipv4/netfilter/ip_nat_standalone.c 2004-08-25 22:22:36.461340035 +0200
+++ linux-2.6.9-rc1-find_helper/net/ipv4/netfilter/ip_nat_standalone.c 2004-08-25 22:29:30.047102589 +0200
@@ -394,4 +394,5 @@
EXPORT_SYMBOL(ip_nat_mangle_tcp_packet);
EXPORT_SYMBOL(ip_nat_mangle_udp_packet);
EXPORT_SYMBOL(ip_nat_used_tuple);
+EXPORT_SYMBOL(ip_nat_find_helper);
MODULE_LICENSE("GPL");
--
- Harald Welte <laforge@netfilter.org> http://www.netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2004-08-25 20:38 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-24 7:49 Linus Torvalds
2004-08-24 16:40 ` Linux 2.6.9-rc1 (compile stats) John Cherry
2004-08-24 16:41 ` Linux 2.6.9-rc1 Pierre Ossman
2004-08-24 16:46 ` Russell King
2004-08-24 16:59 ` Pierre Ossman
2004-08-24 17:50 ` Alexander Gran
2004-08-24 18:42 ` Matt Mackall
2004-08-24 19:23 ` Linus Torvalds
2004-08-24 19:38 ` Chris Meadors
2004-08-24 19:54 ` Florian Weimer
2004-08-24 20:13 ` Josh Boyer
2004-08-24 20:25 ` Jesper Juhl
2004-08-24 20:07 ` Tim Schmielau
2004-08-24 20:32 ` Matt Mackall
2004-08-24 21:22 ` Martin J. Bligh
2004-08-24 22:55 ` Dave Hansen
2004-08-24 22:52 ` H. Peter Anvin
2004-08-24 23:46 ` Dâniel Fraga
2004-08-25 0:11 ` Daniel Andersen
2004-08-25 1:01 ` Dâniel Fraga
2004-08-25 4:24 ` H. Peter Anvin
2004-08-25 20:36 ` Bill Davidsen
2004-08-25 0:25 ` Stephen Wille Padnos
2004-08-25 1:11 ` Dâniel Fraga
2004-08-25 9:13 ` Geert Uytterhoeven
2004-08-25 20:18 ` Bill Davidsen
2004-08-24 18:54 ` Chris Wedgwood
2004-08-24 21:48 ` H. Peter Anvin
2004-08-24 21:58 ` Randy.Dunlap
2004-08-25 14:45 ` Chris Friesen
2004-08-25 16:12 ` Matthias Andree
2004-08-25 18:52 ` Joshua Kwan
2004-08-25 20:32 ` Harald Welte [this message]
2004-08-25 21:35 ` Henrik Nordstrom
2004-08-25 23:48 ` Harald Welte
2004-08-25 23:44 ` David S. Miller
2004-08-26 3:14 ` Joshua Kwan
2004-08-26 8:02 ` Harald Welte
2004-08-26 5:07 ` Mark Lord
[not found] ` <20040825231407.058b3ea6.davem@redhat.com>
2004-08-26 6:15 ` David S. Miller
2004-08-31 17:34 ` 2.6.9-rc1: missing netfilter help texts Adrian Bunk
2004-08-31 18:40 ` [netfilter-core] " Harald Welte
2004-08-25 0:31 Linux 2.6.9-rc1 Sartorelli, Kevin
2004-08-25 1:05 ` Daniel Andersen
2004-08-25 1:20 ` Linus Torvalds
2004-08-25 14:52 ` Martin J. Bligh
2004-08-25 21:14 ` Roman Zippel
2004-08-26 8:09 ` Denis Vlasenko
2004-08-26 8:35 ` Geert Uytterhoeven
2004-08-27 12:45 ` Horst von Brand
2004-08-27 21:30 ` Denis Vlasenko
2004-08-25 20:27 ` Bill Davidsen
2004-08-25 22:20 David Mansfield
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=20040825203206.GS5824@sunbeam.de.gnumonks.org \
--to=laforge@netfilter.org \
--cc=davem@redhat.com \
--cc=joshk@triplehelix.org \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®