netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: David <david@unsolicited.net>
Cc: "Patrick McHardy" <kaber@trash.net>,
	"Ismail Dönmez" <ismail@pardus.org.tr>,
	netdev@vger.kernel.org
Subject: Re: Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
Date: Mon, 19 Nov 2007 22:24:24 +0300	[thread overview]
Message-ID: <20071119192423.GA26449@2ka.mipt.ru> (raw)
In-Reply-To: <4741DB3A.2030304@unsolicited.net>

On Mon, Nov 19, 2007 at 06:51:38PM +0000, David (david@unsolicited.net) wrote:
> Patrick McHardy wrote:
> >>>>     iptables -t nat -A PREROUTING -j REDIRECT -i eth2 -p udp --dport
> >>>> 5061 --to-ports 5060
> >>>>
> >>>>         
> >>> Also post the kernel panic log.
> >>>       
> >
> > Please try if this patch fixes the problem.
> 
> No luck with the patch I'm afraid, panic log attached (of patched kernel).

Ok, let's try it hard way.
Please check attached patch and tell if it helped (it will produce
some debug though).
What is a load on this machine? Is it simple enough to reproduce?
I will take closer look tomorrow if this will not help.

Thanks.

diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
index 70e7997..7dc3496 100644
--- a/net/ipv4/netfilter/nf_nat_core.c
+++ b/net/ipv4/netfilter/nf_nat_core.c
@@ -607,13 +607,13 @@ static void nf_nat_move_storage(struct nf_conn *conntrack, void *old)
 	struct nf_conn_nat *new_nat = nf_ct_ext_find(conntrack, NF_CT_EXT_NAT);
 	struct nf_conn_nat *old_nat = (struct nf_conn_nat *)old;
 	struct nf_conn *ct = old_nat->ct;
-	unsigned int srchash;
+	
+	printk("conntrack: %p, new: %p, old: %p, ct: %p.\n",
+			conntrack, new_nat, old_nat, ct);
 
-	if (!(ct->status & IPS_NAT_DONE_MASK))
+	if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
 		return;
 
-	srchash = hash_by_src(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
-
 	write_lock_bh(&nf_nat_lock);
 	hlist_replace_rcu(&old_nat->bysource, &new_nat->bysource);
 	new_nat->ct = ct;

-- 
	Evgeniy Polyakov

  reply	other threads:[~2007-11-19 19:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-18 19:00 Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8) David
2007-11-18 19:31 ` Ismail Dönmez
2007-11-18 19:34   ` David
2007-11-18 19:54     ` Patrick McHardy
2007-11-19 18:51       ` David
2007-11-19 19:24         ` Evgeniy Polyakov [this message]
2007-11-19 19:31           ` Evgeniy Polyakov
2007-11-19 19:59             ` David
2007-11-20 11:55               ` Evgeniy Polyakov
2007-11-20 12:09                 ` David Miller
2007-11-20 12:11                 ` Patrick McHardy
2007-11-20 12:24                   ` Patrick McHardy
2007-11-20 12:27                     ` David Miller
2007-11-20 13:22                     ` Evgeniy Polyakov

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=20071119192423.GA26449@2ka.mipt.ru \
    --to=johnpol@2ka.mipt.ru \
    --cc=david@unsolicited.net \
    --cc=ismail@pardus.org.tr \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).