All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Eric Leblond <eric@regit.org>, netfilter-devel@vger.kernel.org
Subject: Re: netfilter: REJECT: separate reusable code
Date: Wed, 5 Feb 2014 12:01:46 +0000	[thread overview]
Message-ID: <20140205120145.GB27444@macbook.localnet> (raw)
In-Reply-To: <20140205111713.GB4660@localhost>

On Wed, Feb 05, 2014 at 12:17:13PM +0100, Pablo Neira Ayuso wrote:
> On Wed, Feb 05, 2014 at 10:53:48AM +0000, Patrick McHardy wrote:
> > On Wed, Feb 05, 2014 at 11:42:47AM +0100, Pablo Neira Ayuso wrote:
> > > On Wed, Feb 05, 2014 at 10:25:48AM +0000, Patrick McHardy wrote:
> > > > Just noticed commit cc70d069 (netfilter: REJECT: separate reusable code).
> > > > That doesn't look like a good idea to me at all.
> > > > 
> > > > First of all, it introduces static non-inline functions into a header file,
> > > > which is obviously wrong. But more importantly, it adds a symbol dependency
> > > > of the reject module on IPv6. We've tried hard to get rid of all these in
> > > > x_tables, lets please not re-add them in nftables.
> > > 
> > > Well, I think this is working at this moment, we can improve it of
> > > course.
> > 
> > Sure. I'd just prefer to have it done right from the beginning instead
> > of having to fix it up afterwards if we already know of these problems.
> > It just takes more time this way.
> > 
> > I wonder if we could add something that would break compilation for
> > anything in net/netfilter depending on the ipv6 module. It keeps
> > happening again and again.
> 
> We are using this trick thing in Kconfig:
> 
> depends on (IPV6 || IPV6=n)
> 
> and similar thing in NFT_REJECT
> 
> depends on NF_TABLES_IPV6 || !NF_TABLES_IPV6
> 
> it's not nice, but it seems to work to avoid buildbot reports.

That's not what I meant. I *want* to break compilation if anything in
net/netfilter depends on a symbol of the IPV6 module. Its wrong, with
the only exception being stuff for NFPROTO_INET.

> > > > I think we should instead use AF-specific modules for things like that.
> > > > We share basically no code except the boiler plate. I'd suggest to add
> > > > an AF-specific expression type lookup mechanism that takes precedence
> > > > over generic types.
> > > 
> > > Yes, this looks like the way to go to me.
> > > 
> > > How do you plan to handle this with the inet table? We don't have
> > > family context there.
> > 
> > Hmm good question indeed. We do have it at runtime, but this would
> > obviously also mean we'd also have to dispatch at runtime.
> > 
> > I guess an NFPROTO_INET specific reject module that dispatches to
> > the IPv4 and IPv6 versions is the only possibility unless we want
> > to add restrictions (which I don't).
> 
> I think that, once the infrastructure to provide expressions per
> family in place, a specific reject for inet is a good idea. It can
> reply depending on the packet family that it sees at _eval(...). I
> don't have any better idea on how to handle this case.

Yes, that seems fine, its in fact pretty much what we're doing right
now.

      parent reply	other threads:[~2014-02-05 12:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 10:25 netfilter: REJECT: separate reusable code Patrick McHardy
2014-02-05 10:42 ` Pablo Neira Ayuso
2014-02-05 10:53   ` Patrick McHardy
2014-02-05 11:17     ` Pablo Neira Ayuso
2014-02-05 11:49       ` Arturo Borrero Gonzalez
2014-02-05 11:50         ` Arturo Borrero Gonzalez
2014-02-05 12:04         ` Patrick McHardy
2014-02-05 12:01       ` Patrick McHardy [this message]

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=20140205120145.GB27444@macbook.localnet \
    --to=kaber@trash.net \
    --cc=eric@regit.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@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.