diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2023-02-21 08:54:00 +0300 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2023-02-24 12:07:24 +0300 |
commit | c276a706ea1f51cf9723ed8484feceaf961b8f89 (patch) | |
tree | f4a884a9334bf740905f9a7bef2e8c65dcf14569 | |
parent | 8222d5910dae08213b6d9d4bc9a7f8502855e624 (diff) | |
download | linux-c276a706ea1f51cf9723ed8484feceaf961b8f89.tar.xz |
xfrm: Allow transport-mode states with AF_UNSPEC selector
xfrm state selectors are matched against the inner-most flow
which can be of any address family. Therefore middle states
in nested configurations need to carry a wildcard selector in
order to work at all.
However, this is currently forbidden for transport-mode states.
Fix this by removing the unnecessary check.
Fixes: 13996378e658 ("[IPSEC]: Rename mode to outer_mode and add inner_mode")
Reported-by: David George <David.George@sophos.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
-rw-r--r-- | net/xfrm/xfrm_state.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 00afe831c71c..f238048bf786 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -2815,11 +2815,6 @@ int __xfrm_init_state(struct xfrm_state *x, bool init_replay, bool offload, goto error; } - if (!(inner_mode->flags & XFRM_MODE_FLAG_TUNNEL)) { - NL_SET_ERR_MSG(extack, "Only tunnel modes can accommodate an AF_UNSPEC selector"); - goto error; - } - x->inner_mode = *inner_mode; if (x->props.family == AF_INET) |