[RAMEN9610-20741]UPSTREAM: xfrm: Extend the output_mark to support input direction...
authorSteffen Klassert <steffen.klassert@secunet.com>
Tue, 12 Jun 2018 10:44:26 +0000 (12:44 +0200)
committerrobot <robot@samsung.com>
Sun, 27 Oct 2019 17:53:34 +0000 (02:53 +0900)
commit3542b0fe73deaa07072ecfb26e01d01f201c1356
tree53e0a4464775c802f12b16cbe719d4447547eaf9
parent07c46aac80bb756bcb8c2d2f92f4ca791f42192e
[RAMEN9610-20741]UPSTREAM: xfrm: Extend the output_mark to support input direction and masking.

We already support setting an output mark at the xfrm_state,
unfortunately this does not support the input direction and
masking the marks that will be applied to the skb. This change
adds support applying a masked value in both directions.

The existing XFRMA_OUTPUT_MARK number is reused for this purpose
and as it is now bi-directional, it is renamed to XFRMA_SET_MARK.

An additional XFRMA_SET_MARK_MASK attribute is added for setting the
mask. If the attribute mask not provided, it is set to 0xffffffff,
keeping the XFRMA_OUTPUT_MARK existing 'full mask' semantics.

Co-developed-by: Tobias Brunner <tobias@strongswan.org>
Co-developed-by: Eyal Birger <eyal.birger@gmail.com>
Co-developed-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Tobias Brunner <tobias@strongswan.org>
Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
(cherry picked from commit 9b42c1f179a614e11893ae4619f0304a38f481ae)
Signed-off-by: Benedict Wong <benedictwong@google.com>
Bug: 113046120
Change-Id: I582f0b460dc58f01e0c30afb6167725aa337d054
include/net/xfrm.h
include/uapi/linux/xfrm.h
net/xfrm/xfrm_device.c
net/xfrm/xfrm_input.c
net/xfrm/xfrm_output.c
net/xfrm/xfrm_policy.c
net/xfrm/xfrm_user.c