All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roberto Nibali <ratz@tac.ch>
To: Patrick McHardy <kaber@trash.net>
Cc: Willy Tarreau <willy@w.ods.org>,
	Netfilter Developers <netfilter-devel@lists.netfilter.org>,
	Roberto Nibali <ratz@drugphish.ch>
Subject: Re: [PATCH 2.4] raw table and NOTRACK support
Date: Mon, 28 Nov 2005 10:11:29 +0100	[thread overview]
Message-ID: <438AC9C1.2060405@tac.ch> (raw)
In-Reply-To: <4389FFB6.8000705@trash.net>

> One of the things it broke was SO_ORIGINAL_DST support for
> transparent proxying, which also affects 2.4.

Ok.

>> That would be perfect, could you point me to the git reference to this
>> patch, please?
> 
> It was commit 84531c24f27b02daa8e54e2bb6dc74a730fdf0a5, titled
> "[NETFILTER]: Revert nf_reset change".

Hmmm, so how about the following approach?

--- linux-2.4.32-orig/include/net/dst.h 2005-04-04 03:42:20 +0200
+++ linux-2.4.32-pab2/include/net/dst.h 2005-11-28 09:42:59 +0100
@@ -105,6 +105,7 @@
  void dst_release(struct dst_entry * dst)
  {
         if (dst) {
+               WARN_ON(atomic_read(&dst->__refcnt) < 1);
                 smp_mb__before_atomic_dec();
                 atomic_dec(&dst->__refcnt);
         }
diff -X dontdiff -Nur linux-2.4.32-orig/net/packet/af_packet.c 
linux-2.4.32-pab2/net/packet/af_packet.c
--- linux-2.4.32-orig/net/packet/af_packet.c    2004-11-17 12:54:22 +0100
+++ linux-2.4.32-pab2/net/packet/af_packet.c    2005-11-28 10:00:27 +0100
@@ -272,6 +272,11 @@
         if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
                 goto oom;

+       /* drop any routing info and conntrack reference */
+       dst_release(skb->dst);
+       skb->dst = NULL;
+       nf_reset(skb);
+
         spkt = (struct sockaddr_pkt*)skb->cb;

         skb_push(skb, skb->data-skb->mac.raw);
@@ -507,6 +512,12 @@

         skb_set_owner_r(skb, sk);
         skb->dev = NULL;
+
+       /* drop any routing info and conntrack reference */
+       dst_release(skb->dst);
+       skb->dst = NULL;
+       nf_reset(skb);
+
         spin_lock(&sk->receive_queue.lock);
         po->stats.tp_packets++;
         __skb_queue_tail(&sk->receive_queue, skb);

I'm compiling it now and will be running test, so long as the thing even 
boots ;).

I think the WARN_ON could be submitted to 2.4.x anyway since it helps 
finding other occurances of wrong refcnt decreasing. Why is the routing 
entry dropped in 2.6.x and not in 2.4.x? Maybe I should also cc netdev 
as well.

Thanks and best regards,
Roberto Nibali, ratz
-- 
-------------------------------------------------------------
addr://Kasinostrasse 30, CH-5001 Aarau tel://++41 62 823 9355
http://www.terreactive.com             fax://++41 62 823 9356
-------------------------------------------------------------
terreActive AG                       Wir sichern Ihren Erfolg
-------------------------------------------------------------

  reply	other threads:[~2005-11-28  9:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-21 10:26 [PATCH 2.4] raw table and NOTRACK support Roberto Nibali
2005-11-22 14:14 ` Roberto Nibali
2005-11-22 15:40   ` Roberto Nibali
2005-11-22 15:54     ` Roberto Nibali
2005-11-23 13:04       ` Roberto Nibali
2005-11-27 15:36         ` Patrick McHardy
2005-11-27 18:22           ` Roberto Nibali
2005-11-27 18:49             ` Patrick McHardy
2005-11-28  9:11               ` Roberto Nibali [this message]
2005-11-28  9:47                 ` Roberto Nibali

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=438AC9C1.2060405@tac.ch \
    --to=ratz@tac.ch \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=ratz@drugphish.ch \
    --cc=willy@w.ods.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.