xfrm: Remove inner/outer modes from input path
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 10 Mar 2023 09:26:05 +0000 (17:26 +0800)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 13 Mar 2023 10:51:13 +0000 (11:51 +0100)
commit5f24f41e8ea62a6a9095f9bbafb8b3aebe265c68
treeb0912e99ded2a836115edd5b0c0aa7b0a7fdb9aa
parent95b744508d4d5135ae2a096ff3f0ee882bcc52b3
xfrm: Remove inner/outer modes from input path

The inner/outer modes were added to abstract out common code that
were once duplicated between IPv4 and IPv6.  As time went on the
abstractions have been removed and we are now left with empty
shells that only contain duplicate information.  These can be
removed one-by-one as the same information is already present
elsewhere in the xfrm_state object.

Removing them from the input path actually allows certain valid
combinations that are currently disallowed.  In particular, when
a transport mode SA sits beneath a tunnel mode SA that changes
address families, at present the transport mode SA cannot have
AF_UNSPEC as its selector because it will be erroneously be treated
as inter-family itself even though it simply sits beneath one.

This is a serious problem because you can't set the selector to
non-AF_UNSPEC either as that will cause the selector match to
fail as we always match selectors to the inner-most traffic.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_input.c