From: Steffen Klassert Date: Tue, 12 Jun 2018 12:07:12 +0000 (+0200) Subject: UPSTREAM: xfrm: Add virtual xfrm interfaces X-Git-Tag: MMI-RSA31.Q1-48-36-11~81 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4748a9c1dd8edd4fbe4dc710df1ae51e442a0012;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git UPSTREAM: xfrm: Add virtual xfrm interfaces This patch adds support for virtual xfrm interfaces. Packets that are routed through such an interface are guaranteed to be IPsec transformed or dropped. It is a generic virtual interface that ensures IPsec transformation, no need to know what happens behind the interface. This means that we can tunnel IPv4 and IPv6 through the same interface and support all xfrm modes (tunnel, transport and beet) on it. Co-developed-by: Lorenzo Colitti Co-developed-by: Benedict Wong Signed-off-by: Lorenzo Colitti Signed-off-by: Benedict Wong Signed-off-by: Steffen Klassert Acked-by: Shannon Nelson Tested-by: Benedict Wong Tested-by: Antony Antony Reviewed-by: Eyal Birger (cherry picked from commit f203b76d78092faf248db3f851840fbecf80b40e) Bug: 113046120 Change-Id: I05e8fe1e8a8a4b01886504ce694ddda29e4fbec6 --- diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 7fc1b252317d..1ca20fa8e001 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -2418,6 +2418,8 @@ int __xfrm_decode_session(struct sk_buff *skb, struct flowi *fl, unsigned int family, int reverse) { const struct xfrm_policy_afinfo *afinfo = xfrm_policy_get_afinfo(family); + const struct xfrm_if_cb *ifcb = xfrm_if_get_cb(); + struct xfrm_if *xi; int err; if (unlikely(afinfo == NULL))