summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2026-06-09 17:02:12 +0300
committerSteffen Klassert <steffen.klassert@secunet.com>2026-06-09 17:02:12 +0300
commit355f808d8a11fa69b19dfd8811bc87d97830f5d6 (patch)
treeeadc95f807ba7af7192412b5c2a0e6386a7564c1 /tools/lib/python
parent41c4d3b26f5e23609cd4b5ca561a399a097daabe (diff)
parentc13c0cc6f52e491186f6521dc80031c35737162d (diff)
downloadlinux-355f808d8a11fa69b19dfd8811bc87d97830f5d6.tar.xz
Merge branch 'xfrm: XFRM_MSG_MIGRATE_STATE new netlink message'
Antony Antony says: ==================== The current XFRM_MSG_MIGRATE interface is tightly coupled to policy and SA migration, and it lacks the information required to reliably migrate individual SAs. This makes it unsuitable for IKEv2 deployments, dual-stack setups (IPv4/IPv6), and scenarios where policies are managed externally (e.g., by daemons other than the IKE daemon). Mandatory SA selector list The current API requires a non-empty SA selector list, which does not reflect the IKEv2 use case. A single Child SA may correspond to multiple policies, and SA discovery already occurs via address and reqid matching. With dual-stack Child SAs this leads to excessive churn: the current method would have to be called up to six times (in/out/fwd × v4/v6) on SA, while the new method only requires two calls. Selectors lack SPI (and marks) XFRM_MSG_MIGRATE cannot uniquely identify an SA when multiple SAs share the same policies (per-CPU SAs, SELinux label-based SAs, etc.). Without the SPI, the kernel may update the wrong SA instance. Reqid cannot be changed Some implementations allocate reqids based on traffic selectors. In host-to-host or selector-changing scenarios, the reqid must change, which the current API cannot express. Because strongSwan and other implementations manage policies independently of the kernel, an interface that updates only a specific SA - with complete and unambiguous identification - is required. SA Selector, x->sel, can't be changed, especially Transport mode. XFRM_MSG_MIGRATE_STATE provides that interface. It supports migration of a single SA via xfrm_usersa_id (including SPI) and we fix encap removal in this patch set, reqid updates, address changes, and other SA-specific parameters. It avoids the structural limitations of XFRM_MSG_MIGRATE and provides a simpler, extensible mechanism for precise per-SA migration without involving policies. This method also allows migtrating SA selectors typically used with host-to-host in Transport mode. New migration steps: first install block policy, remove the old policy, call XFRM_MSG_MIGRATE_STATE for each state, then re-install the policies and remove the block policy. If the target SA tuple (daddr, SPI, proto, family) is already occupied, the operation returns -EEXIST. In this case the original SA is not preserved. Userspace must handle -EEXIST by re-establishing the SA at the IKE level and manage policies. ==================== Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions