All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: [PATCH NF_CONNTRACK 6/9]: Drop conntrack reference when packet leaves IPv6
Date: Sat, 11 Jun 2005 17:33:38 +0200	[thread overview]
Message-ID: <42AB0452.3010703@trash.net> (raw)
In-Reply-To: <200505230620.j4N6KAve018200@toshiba.co.jp>

Yasuyuki KOZAKAI wrote:
> This patch is for IPv6 and same change as follows.

Why not simply drop the reference earlier in ip6_input_finish()
before the packet is delivered to raw sockets?

Regards
Patrick

> diff -Nur linux-2.6.12-rc4-nfct-5-drop-ref/net/ipv6/ip6_input.c linux-2.6.12-rc4-nfct-6-drop-ref6/net/ipv6/ip6_input.c
> --- linux-2.6.12-rc4-nfct-5-drop-ref/net/ipv6/ip6_input.c	2005-05-20 03:29:38.000000000 +0900
> +++ linux-2.6.12-rc4-nfct-6-drop-ref6/net/ipv6/ip6_input.c	2005-05-19 21:28:26.000000000 +0900
> @@ -176,6 +176,11 @@
>  		if (ipprot->flags & INET6_PROTO_FINAL) {
>  			struct ipv6hdr *hdr;	
>  
> +			/* Free reference early: we don't need it any more,
> +			   and it may hold ip_conntrack module loaded
> +			   indefinitely. */
> +			nf_reset(skb);
> +
>  			skb_postpull_rcsum(skb, skb->nh.raw,
>  					   skb->h.raw - skb->nh.raw);
>  			hdr = skb->nh.ipv6h;
> diff -Nur linux-2.6.12-rc4-nfct-5-drop-ref/net/ipv6/raw.c linux-2.6.12-rc4-nfct-6-drop-ref6/net/ipv6/raw.c
> --- linux-2.6.12-rc4-nfct-5-drop-ref/net/ipv6/raw.c	2005-05-20 03:29:46.000000000 +0900
> +++ linux-2.6.12-rc4-nfct-6-drop-ref6/net/ipv6/raw.c	2005-05-19 21:51:35.000000000 +0900
> @@ -167,8 +167,10 @@
>  			struct sk_buff *clone = skb_clone(skb, GFP_ATOMIC);
>  
>  			/* Not releasing hash table! */
> -			if (clone)
> +			if (clone) {
> +				nf_reset(clone);
>  				rawv6_rcv(sk, clone);
> +			}
>  		}
>  		sk = __raw_v6_lookup(sk_next(sk), nexthdr, daddr, saddr);
>  	}

  reply	other threads:[~2005-06-11 15:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-23  6:20 [PATCH NF_CONNTRACK 6/9]: Drop conntrack reference when packet leaves IPv6 Yasuyuki KOZAKAI
2005-06-11 15:33 ` Patrick McHardy [this message]
2005-06-13  0:58   ` Yasuyuki KOZAKAI
     [not found]   ` <200506130058.j5D0wRPG007718@toshiba.co.jp>
2005-06-14  1:21     ` 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=42AB0452.3010703@trash.net \
    --to=kaber@trash.net \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=yasuyuki.kozakai@toshiba.co.jp \
    /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.