diff options
| author | Christian Hopps <[email protected]> | 2024-11-14 07:07:02 +0000 |
|---|---|---|
| committer | Steffen Klassert <[email protected]> | 2024-12-05 09:01:28 +0000 |
| commit | d1716d5a44c37e5743bf6ea4e5cdbdab37727f27 (patch) | |
| tree | f0acee1586e60852300c49b1eb16577a89ea01d9 /net/xfrm/xfrm_user.c | |
| parent | xfrm: add mode_cbs module functionality (diff) | |
| download | kernel-d1716d5a44c37e5743bf6ea4e5cdbdab37727f27.tar.gz kernel-d1716d5a44c37e5743bf6ea4e5cdbdab37727f27.zip | |
xfrm: add generic iptfs defines and functionality
Define `XFRM_MODE_IPTFS` and `IPSEC_MODE_IPTFS` constants, and add these to
switch case and conditionals adjacent with the existing TUNNEL modes.
Signed-off-by: Christian Hopps <[email protected]>
Tested-by: Antony Antony <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>
Diffstat (limited to 'net/xfrm/xfrm_user.c')
| -rw-r--r-- | net/xfrm/xfrm_user.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 71b452fff8db..08c6d6f0179f 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -383,6 +383,16 @@ static int verify_newsa_info(struct xfrm_usersa_info *p, case XFRM_MODE_ROUTEOPTIMIZATION: case XFRM_MODE_BEET: break; + case XFRM_MODE_IPTFS: + if (p->id.proto != IPPROTO_ESP) { + NL_SET_ERR_MSG(extack, "IP-TFS mode only supported with ESP"); + goto out; + } + if (sa_dir == 0) { + NL_SET_ERR_MSG(extack, "IP-TFS mode requires in or out direction attribute"); + goto out; + } + break; default: NL_SET_ERR_MSG(extack, "Unsupported mode"); @@ -2014,6 +2024,8 @@ static int validate_tmpl(int nr, struct xfrm_user_tmpl *ut, u16 family, return -EINVAL; } break; + case XFRM_MODE_IPTFS: + break; default: if (ut[i].family != prev_family) { NL_SET_ERR_MSG(extack, "Mode in template doesn't support a family change"); |
