From: Steffen Klassert <steffen.klassert@secunet.com>
To: Lorenzo Colitti <lorenzo@google.com>
Cc: <netdev@vger.kernel.org>, <davem@davemloft.net>,
<jhs@mojatatu.com>, <herbert@gondor.apana.org.au>
Subject: Re: [PATCH ipsec-next] net: xfrm: support setting an output mark.
Date: Fri, 11 Aug 2017 12:55:12 +0200 [thread overview]
Message-ID: <20170811105511.GD22049@secunet.com> (raw)
In-Reply-To: <20170810171133.69254-1-lorenzo@google.com>
On Fri, Aug 11, 2017 at 02:11:33AM +0900, Lorenzo Colitti wrote:
> On systems that use mark-based routing it may be necessary for
> routing lookups to use marks in order for packets to be routed
> correctly. An example of such a system is Android, which uses
> socket marks to route packets via different networks.
>
> Currently, routing lookups in tunnel mode always use a mark of
> zero, making routing incorrect on such systems.
>
> This patch adds a new output_mark element to the xfrm state and
> a corresponding XFRMA_OUTPUT_MARK netlink attribute. The output
> mark differs from the existing xfrm mark in two ways:
>
> 1. The xfrm mark is used to match xfrm policies and states, while
> the xfrm output mark is used to set the mark (and influence
> the routing) of the packets emitted by those states.
> 2. The existing mark is constrained to be a subset of the bits of
> the originating socket or transformed packet, but the output
> mark is arbitrary and depends only on the state.
>
> The use of a separate mark provides additional flexibility. For
> example:
>
> - A packet subject to two transforms (e.g., transport mode inside
> tunnel mode) can have two different output marks applied to it,
> one for the transport mode SA and one for the tunnel mode SA.
> - On a system where socket marks determine routing, the packets
> emitted by an IPsec tunnel can be routed based on a mark that
> is determined by the tunnel, not by the marks of the
> unencrypted packets.
> - Support for setting the output marks can be introduced without
> breaking any existing setups that employ both mark-based
> routing and xfrm tunnel mode. Simply changing the code to use
> the xfrm mark for routing output packets could xfrm mark could
> change behaviour in a way that breaks these setups.
>
> If the output mark is unspecified or set to zero, the mark is not
> set or changed.
>
> Tested: make allyesconfig; make -j64
> Tested: https://android-review.googlesource.com/452776
> Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Patch applied to ipsec-next, thanks Lorenzo!
prev parent reply other threads:[~2017-08-11 10:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-10 17:11 [PATCH ipsec-next] net: xfrm: support setting an output mark Lorenzo Colitti
2017-08-11 10:55 ` Steffen Klassert [this message]
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=20170811105511.GD22049@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=jhs@mojatatu.com \
--cc=lorenzo@google.com \
--cc=netdev@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).