netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Harout Hedeshian <harouth@codeaurora.org>
Cc: netfilter-devel@vger.kernel.org, Lorenzo Colitti <lorenzo@google.com>
Subject: Re: [PATCH iptables] xt_socket: add --restore-skmark option
Date: Thu, 18 Jun 2015 21:03:12 +0200	[thread overview]
Message-ID: <20150618190312.GA32336@salvia> (raw)
In-Reply-To: <1434415279-15517-1-git-send-email-harouth@codeaurora.org>

On Mon, Jun 15, 2015 at 06:41:19PM -0600, Harout Hedeshian wrote:
> xt_socket is useful for matching sockets with IP_TRANSPARENT and
> taking some action on the matching packets. However, it lacks the
> ability to match only a small subset of transparent sockets.
> 
> Suppose there are 2 applications, each with its own set of transparent
> sockets. The first application wants all matching packets dropped,
> while the second application wants them forwarded somewhere else.
> 
> Add the ability to retore the skb->mark from the sk_mark. The mark
> is only restored if a matching socket is found and the transparent /
> nowildcard conditions are satisfied.
> 
> Now the 2 hypothetical applications can differentiate their sockets
> based on a mark value set with SO_MARK.
> 
> iptables -t mangle -I PREROUTING -m socket --transparent \
>                                            --restore-skmark -j action
> iptables -t mangle -I PREROUTING -m socket --transparent \
>                                            --restore-skmark -j action
> iptables -t mangle -A action -m mark --mark 10 -j action2
> iptables -t mangle -A action -m mark --mark 11 -j action3

Applied, thanks Harout.



  reply	other threads:[~2015-06-18 18:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16  0:41 [PATCH iptables] xt_socket: add --restore-skmark option Harout Hedeshian
2015-06-18 19:03 ` Pablo Neira Ayuso [this message]
2015-06-30 15:27 ` Pablo Neira Ayuso
2015-06-30 15:59   ` Harout Hedeshian

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=20150618190312.GA32336@salvia \
    --to=pablo@netfilter.org \
    --cc=harouth@codeaurora.org \
    --cc=lorenzo@google.com \
    --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;
as well as URLs for NNTP newsgroup(s).