All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Oester <kernel@linuxace.com>
To: Harald Welte <laforge@netfilter.org>,
	Patrick McHardy <kaber@trash.net>,
	Henrik Nordstrom <hno@marasystems.com>,
	netfilter-devel@lists.netfilter.org, jens@hoelldampf.net
Subject: Re: SO_ORIGINAL_DST does not work in nat/OUTPUT anymore
Date: Sun, 10 Jul 2005 15:20:06 -0700	[thread overview]
Message-ID: <20050710222006.GA11812@linuxace.com> (raw)
In-Reply-To: <20050710202359.GA6874@sunbeam.de.gnumonks.org>

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

On Sun, Jul 10, 2005 at 10:24:00PM +0200, Harald Welte wrote:
> On Sun, Jul 10, 2005 at 07:53:16PM +0200, Patrick McHardy wrote:
> 
> > Thanks for the hint. Harald, if I can't think of anything else (seems
> > likely) I'll revert the patch.
> 
> Yes, I'm also in favour of reverting the patch.  The number of functional bugs
> it has caused by far outweigh the gain of save 'rmmod' without loops.

I humbly re-resubmit my original patch.  The problem occurs (most frequently)
in the case of raw sockets, which my patch addresses.  Patrick will point out
that stopped qdiscs are not handled by this patch, and I concur.  However, it
would seem that fixing the most common cause of module unload problems is
better than the plethora of problems the alternative patch has caused...

Phil

Signed-off-by: Phil Oester <kernel@linuxace.com>



[-- Attachment #2: patch-unload --]
[-- Type: text/plain, Size: 1938 bytes --]

diff -purN linux-orig/net/ipv4/ip_output.c linux-new/net/ipv4/ip_output.c
--- linux-orig/net/ipv4/ip_output.c	2005-06-17 15:48:29.000000000 -0400
+++ linux-new/net/ipv4/ip_output.c	2005-06-20 14:47:58.000000000 -0400
@@ -196,8 +196,6 @@ static inline int ip_finish_output2(stru
 	nf_debug_ip_finish_output2(skb);
 #endif /*CONFIG_NETFILTER_DEBUG*/
 
-	nf_reset(skb);
-
 	if (hh) {
 		int hh_alen;
 
diff -purN linux-orig/net/ipv4/netfilter/ip_conntrack_standalone.c linux-new/net/ipv4/netfilter/ip_conntrack_standalone.c
--- linux-orig/net/ipv4/netfilter/ip_conntrack_standalone.c	2005-06-17 15:48:29.000000000 -0400
+++ linux-new/net/ipv4/netfilter/ip_conntrack_standalone.c	2005-06-20 14:47:58.000000000 -0400
@@ -432,6 +432,13 @@ static unsigned int ip_conntrack_defrag(
 				        const struct net_device *out,
 				        int (*okfn)(struct sk_buff *))
 {
+#if !defined(CONFIG_IP_NF_NAT) && !defined(CONFIG_IP_NF_NAT_MODULE)
+	/* Previously seen (loopback)?  Ignore.  Do this before
+           fragment check. */
+	if ((*pskb)->nfct)
+		return NF_ACCEPT;
+#endif
+
 	/* Gather fragments. */
 	if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) {
 		*pskb = ip_ct_gather_frags(*pskb,
diff -purN linux-orig/net/packet/af_packet.c linux-new/net/packet/af_packet.c
--- linux-orig/net/packet/af_packet.c	2005-06-17 15:48:29.000000000 -0400
+++ linux-new/net/packet/af_packet.c	2005-06-20 14:48:38.000000000 -0400
@@ -274,6 +274,9 @@ static int packet_rcv_spkt(struct sk_buf
 	dst_release(skb->dst);
 	skb->dst = NULL;
 
+	/* drop conntrack reference */
+	nf_reset(skb);
+
 	spkt = (struct sockaddr_pkt*)skb->cb;
 
 	skb_push(skb, skb->data-skb->mac.raw);
@@ -517,6 +520,9 @@ static int packet_rcv(struct sk_buff *sk
 	dst_release(skb->dst);
 	skb->dst = NULL;
 
+	/* drop conntrack reference */
+	nf_reset(skb);
+
 	spin_lock(&sk->sk_receive_queue.lock);
 	po->stats.tp_packets++;
 	__skb_queue_tail(&sk->sk_receive_queue, skb);

  parent reply	other threads:[~2005-07-10 22:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-10 14:18 SO_ORIGINAL_DST does not work in nat/OUTPUT anymore Jens Hoelldampf
2005-07-10 15:32 ` Harald Welte
2005-07-10 16:18   ` Patrick McHardy
2005-07-10 16:27     ` Henrik Nordstrom
2005-07-10 17:53       ` Patrick McHardy
2005-07-10 20:24         ` Harald Welte
2005-07-10 20:46           ` Patrick McHardy
2005-07-11 11:06             ` Jan Engelhardt
2005-07-11 11:19               ` Patrick McHardy
2005-07-11 11:58               ` Harald Welte
2005-07-10 22:20           ` Phil Oester [this message]
2005-07-10 23:54             ` Patrick McHardy
2005-07-11  9:44               ` Roberto Nibali
2005-07-11 11:16                 ` Patrick McHardy
2005-07-11 11:41                   ` Roberto Nibali
2005-07-11 11:47                     ` Patrick McHardy

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=20050710222006.GA11812@linuxace.com \
    --to=kernel@linuxace.com \
    --cc=hno@marasystems.com \
    --cc=jens@hoelldampf.net \
    --cc=kaber@trash.net \
    --cc=laforge@netfilter.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 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.