All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Fisher <brad@info-link.net>
To: Henrik Nordstrom <hno@marasystems.com>
Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: Re: Suggestion for RETURN target
Date: Wed, 03 Dec 2003 14:30:10 -0600	[thread overview]
Message-ID: <3FCE47D1.C07304F8@info-link.net> (raw)
In-Reply-To: Pine.LNX.4.44.0312032055140.11739-100000@filer.marasystems.com

Henrik Nordstrom wrote:

> On Wed, 3 Dec 2003, Brad Fisher wrote:

> > This is different than my suggestion, since as I envision it,
> > the only time you would go back more than one chain would be if a rule
> > specifically requested it.
>
> Which I see as unneededly complex as it moves the logics to the leaves of
> your rule tree rather than at the branches making it a very interwoven set
> of rules, especially if you call these chains from multiple locations.

I agree it does make the chains hard to follow.

> Try to make a ruleset which makes sense where different levels of return
> are actually used. In the above by making the jumps to chain2/3/4 a goto
> class jump the return would in all cases return to chain1. The difference
> is as you note if you have other levels RETURN statements (including the
> implicit return at the end of the chain). But I seriously question if such
> ruleset design is sane from both a ruleset design perspective and
> maintainability.

My main reason for asking for this feature is so I can shortcut the execution of
rules which are guaranteed to never match (ie. the rules following the jump to
another chain).  For this purpose, the goto idea will work.  I guess I thought
that the ability to return an arbitrary number of levels was "cool", but I can
live without it if something like goto existed.

> > Does anyone have any ideas on whether this would be possible to do and if so
> > would they have any pointers on where I should start looking?  I don't mind
> > writing the code myself...
>
> Neither of the two should be very complex to implement, but both requires
> chainging of the iptables core. It can not be done via the match/target
> interface normally used for extending iptables.

Would there be any chance of a patch for the goto functionality being accepted
then?  I wouldn't mind doing the work as long as I don't have to maintain a custom
patch for myself.  If anyone else is interested, then I'd be open to suggestions
on how it should work.  For example:

  # Normal 'jump' (call)
  iptables -j custom_chain

  # Add '-g' (goto) argument to iptables userspace?
  iptables -g custom_chain

  # Add '--goto' (goto) flag to iptables userspace?
  iptables -j custom_chain --goto

And of course there'd have to be a flag somewhere in the rule/target struct itself
which would indicate the calling chain shouldn't be added to the call stack.

> Regards
> Henrik

Thanks for your input!

-Brad

  reply	other threads:[~2003-12-03 20:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-03  0:35 Suggestion for RETURN target Brad Fisher
2003-12-03  8:19 ` Henrik Nordstrom
2003-12-03 17:26   ` Brad Fisher
2003-12-03 20:11     ` Henrik Nordstrom
2003-12-03 20:30       ` Brad Fisher [this message]
2003-12-03 22:49         ` Henrik Nordstrom
2003-12-04 19:13           ` Brad Fisher
2003-12-04 21:02             ` Henrik Nordstrom

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=3FCE47D1.C07304F8@info-link.net \
    --to=brad@info-link.net \
    --cc=hno@marasystems.com \
    --cc=netfilter-devel@lists.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.