]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfrm: Refactor migration setup during the cloning process
authorChiachang Wang <chiachangwang@google.com>
Thu, 13 Mar 2025 02:36:41 +0000 (02:36 +0000)
committerSteffen Klassert <steffen.klassert@secunet.com>
Thu, 17 Apr 2025 09:00:37 +0000 (11:00 +0200)
commite8961c50ee9cc329b9ba4959aa1b8794fae17ab2
treed21da77b30d8d2cdf9ad641b9173f43ac38ae445
parentab244a394c7f13f6573744b9ca72bb22151a3ec4
xfrm: Refactor migration setup during the cloning process

Previously, migration related setup, such as updating family,
destination address, and source address, was performed after
the clone was created in `xfrm_state_migrate`. This change
moves this setup into the cloning function itself, improving
code locality and reducing redundancy.

The `xfrm_state_clone_and_setup` function now conditionally
applies the migration parameters from struct xfrm_migrate
if it is provided. This allows the function to be used both
for simple cloning and for cloning with migration setup.

Test: Tested with kernel test in the Android tree located
      in https://android.googlesource.com/kernel/tests/
      The xfrm_tunnel_test.py under the tests folder in
      particular.
Signed-off-by: Chiachang Wang <chiachangwang@google.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_state.c