Linux Netfilter development
 help / color / mirror / Atom feed
From: Philip Craig <philipc@snapgear.com>
To: "Horton, Dave" <dhorton@pactolus.com>
Cc: Jan Engelhardt <jengelh@medozas.de>, netfilter-devel@vger.kernel.org
Subject: Re: been a while...what happened to NFC_ALTERED?
Date: Fri, 26 Sep 2008 14:16:51 +1000	[thread overview]
Message-ID: <48DC6233.1020309@snapgear.com> (raw)
In-Reply-To: <E8E029BA163C694484CFEA4914619EA206853DAA@pcsexch-bknet>

Horton, Dave wrote:
> Well, maybe I could use that, or more likely base my kernel module off
> that code.  The reason that I probably can't use the DNAT target as is,
> is because I also have to inspect the packets, and for some (very small)
> number of them, send the packet up to userspace for further processing.
> Also, my userspace process needs to frequently (hundreds of times per
> second) change the forwarding rules, so for performance reasons I want
> to specify those changes via commands over a netlink socket rather than
> adding and removing iptables rules.
> 
> Does that make sense?  Should I be looking at creating a target similar
> to DNAT, and using that code as reference?

Try to use the existing DNAT target if possible.  You can make the DNAT
conditional by putting all your logic in a custom match.  But also
consider using the ipset patch rather than a custom match.  You may
be able to structure the rules so you only need to update the ipset when
your forwarding rules change.  ipset is currently sockopt only, but
netlink version is in progress.

Also do your forwarding rules change per packet or per connection?
Note that iptables nat is based on connection tracking.  If you want per
packet nat decisions (stateless nat) then use iproute2.


  reply	other threads:[~2008-09-26  4:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-25 22:38 been a while...what happened to NFC_ALTERED? Dave Horton
2008-09-25 23:38 ` Jan Engelhardt
2008-09-26  0:47   ` Horton, Dave
2008-09-26  1:12     ` Jan Engelhardt
2008-09-26  1:28       ` Horton, Dave
2008-09-26  1:32         ` Philip Craig
2008-09-26  1:38           ` Horton, Dave
2008-09-26  4:16             ` Philip Craig [this message]
2008-09-28 15:06       ` Horton, Dave
2008-09-26  1:04 ` Philip Craig

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=48DC6233.1020309@snapgear.com \
    --to=philipc@snapgear.com \
    --cc=dhorton@pactolus.com \
    --cc=jengelh@medozas.de \
    --cc=netfilter-devel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox