netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Luciano Coelho <luciano.coelho@nokia.com>,
	Netfilter Developer Mailing List
	<netfilter-devel@vger.kernel.org>,
	netdev@vger.kernel.org, Patrick McHardy <kaber@trash.net>,
	sameo@linux.intel.com
Subject: Re: [RFC 1/1] netfilter: xtables: inclusion of xt_condition
Date: Thu, 22 Jul 2010 22:19:40 +0300	[thread overview]
Message-ID: <20100722191940.GA10029@x200> (raw)
In-Reply-To: <alpine.LSU.2.01.1007221621270.1619@obet.zrqbmnf.qr>

On Thu, Jul 22, 2010 at 04:44:35PM +0200, Jan Engelhardt wrote:
> 
> On Thursday 2010-07-22 16:09, Luciano Coelho wrote:
> >+static int condition_mt_check(const struct xt_mtchk_param *par)
> >+{
> >+	struct xt_condition_mtinfo *info = par->matchinfo;
> >+	struct condition_variable *var;
> >+	struct condition_net *cond_net =
> >+		condition_pernet(current->nsproxy->net_ns);
> 
> Cc'ing Alexey who has done the netns support.
> 
> Alexey, you added par->net, but given Luciano just did it with 
> current->nsproxy->net_ns, do we really need par->net?

In ->check, maybe, we can get away with current->nsproxy->net_ns.

But definitely not in ->destroy(), because destruction can happen
when _no_ task is in netns, so current->nsproxy->net_ns is 100% bogus.

Steps to reproduce:
	iptables -A ...
	exit

->destroy hook gets netns from par->net, ->checkentry does the same
for symmetry and less confusion.

  parent reply	other threads:[~2010-07-22 19:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22 14:09 [RFC 0/1] netfilter: xtables: xt_condition inclusion with namespace fix Luciano Coelho
2010-07-22 14:09 ` [RFC 1/1] netfilter: xtables: inclusion of xt_condition Luciano Coelho
2010-07-22 14:44   ` Jan Engelhardt
2010-07-22 15:16     ` Luciano Coelho
2010-07-22 15:36       ` Jan Engelhardt
2010-07-22 19:26         ` Luciano Coelho
2010-07-22 19:19     ` Alexey Dobriyan [this message]
2010-07-22 19:30       ` Luciano Coelho

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=20100722191940.GA10029@x200 \
    --to=adobriyan@gmail.com \
    --cc=jengelh@medozas.de \
    --cc=kaber@trash.net \
    --cc=luciano.coelho@nokia.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    /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).