All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Fisher <brad@info-link.net>
To: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: Suggestion for RETURN target
Date: Tue, 02 Dec 2003 18:35:43 -0600	[thread overview]
Message-ID: <3FCD2FDF.69796CD5@info-link.net> (raw)

Would it be possible to modify the RETURN target in such a way that it
could return to an arbitrary chain in the call stack instead of only to
the previous chain?  For example, something like:

    iptables -N chain2
    ... other rules for chain2 ...
    iptables -A chain2 -j RETURN --return-to 2

    iptables -N chain1
    iptables -A chain1 <matches> -j chain2
    iptables -A chain1 -j DROP

    iptables -A FORWARD -j chain1

In the above example, the DROP rule in chain1 would never get executed
when the chain2 rule matched since the RETURN target in chain2 would
"return-to" the 2nd to last chain in the call stack instead of the
calling chain.  Perhaps "return-to" isn't the best name...  Something
like "return-levels" or similar would work just as well for me.  The
current behavior would be maintained if the additional parameter was not
given.

If this isn't a possibility, then what about a way to attach a second
(or third, etc?) target to a rule?  The targets would execute in
sequence, with certain obvious ones such as ACCEPT/DROP/REJECT/etc
stopping target execution.  With this, I could write the example above
as follows:

    iptables -N chain2
    ... other rules for chain2 ...

    iptables -N chain1
    iptables -A chain1 <matches> -j chain2,RETURN
    iptables -A chain1 -j DROP

    iptables -A FORWARD -j chain1

Where the sequence "-j chain2,RETURN" means execute chain2, then if it
returns execute a RETURN to the previous chain.

Either of these two approaches would allow me to reduce my ruleset 1/2
the rules currently required.

Anyway, just thought I'd thow it out there to see what others think.

-Brad

             reply	other threads:[~2003-12-03  0:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-03  0:35 Brad Fisher [this message]
2003-12-03  8:19 ` Suggestion for RETURN target Henrik Nordstrom
2003-12-03 17:26   ` Brad Fisher
2003-12-03 20:11     ` Henrik Nordstrom
2003-12-03 20:30       ` Brad Fisher
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=3FCD2FDF.69796CD5@info-link.net \
    --to=brad@info-link.net \
    --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.