All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Harout Hedeshian" <harouth@codeaurora.org>
To: "'Pablo Neira Ayuso'" <pablo@netfilter.org>
Cc: <netfilter-devel@vger.kernel.org>,
	"'Lorenzo Colitti'" <lorenzo@google.com>
Subject: RE: [PATCH nf-next] netfilter: xt_socket: add XT_SOCKET_MATCHSOCKMARK flag and mark fields
Date: Mon, 15 Jun 2015 11:41:51 -0600	[thread overview]
Message-ID: <004101d0a792$90acec60$b206c520$@codeaurora.org> (raw)
In-Reply-To: <20150615162246.GA14375@salvia>



> -----Original Message-----
> From: Pablo Neira Ayuso [mailto:pablo@netfilter.org]
> Sent: Monday, June 15, 2015 10:23 AM
> To: Harout Hedeshian
> Cc: netfilter-devel@vger.kernel.org; Lorenzo Colitti
> Subject: Re: [PATCH nf-next] netfilter: xt_socket: add
> XT_SOCKET_MATCHSOCKMARK flag and mark fields
> 
> On Fri, Jun 12, 2015 at 04:39:55PM -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 match sockets based on the socket mark.
> >
> > 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 --mark 10 -J
> > act1 iptables -t mangle -I PREROUTING -m socket --transparent --mark
> > 11 -J act2
> 
> Wouldn't it be better to restore the sk_mark to skb->mark? I mean:
> 
>         iptables -t mangle -I PREROUTING \
>                 -m socket --transparent --restore-skmark -j myskchain
> 
> Thus, you can use -m mark from the 'myskchain' without having to fetch
> and inspect the sk over and over again as it happens with this
> extension.

Yes, I think that can work. Let me try that out and I'll submit a new patch.


  reply	other threads:[~2015-06-15 17:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 22:39 [PATCH nf-next] netfilter: xt_socket: add XT_SOCKET_MATCHSOCKMARK flag and mark fields Harout Hedeshian
2015-06-15 16:22 ` Pablo Neira Ayuso
2015-06-15 17:41   ` Harout Hedeshian [this message]
2015-06-15 19:39   ` Harout Hedeshian
2015-06-15 20:57     ` Pablo Neira Ayuso
2015-06-16  0:45       ` 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='004101d0a792$90acec60$b206c520$@codeaurora.org' \
    --to=harouth@codeaurora.org \
    --cc=lorenzo@google.com \
    --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.