diff options
| author | Steffen Klassert <[email protected]> | 2025-04-18 08:58:23 +0000 |
|---|---|---|
| committer | Steffen Klassert <[email protected]> | 2025-04-18 08:58:23 +0000 |
| commit | 86e530c84c9701e653a324df970c25ca3ffee390 (patch) | |
| tree | d21da77b30d8d2cdf9ad641b9173f43ac38ae445 /net/xfrm/xfrm_user.c | |
| parent | Merge branch 'xfrm & bonding: Correct use of xso.real_dev' (diff) | |
| parent | xfrm: Refactor migration setup during the cloning process (diff) | |
| download | kernel-86e530c84c9701e653a324df970c25ca3ffee390.tar.gz kernel-86e530c84c9701e653a324df970c25ca3ffee390.zip | |
Merge branch 'Update offload configuration with SA'
Chiachang Wang says:
====================
The current Security Association (SA) offload setting
cannot be modified without removing and re-adding the
SA with the new configuration. Although existing netlink
messages allow SA migration, the offload setting will
be removed after migration.
This patchset enhances SA migration to include updating
the offload setting. This is beneficial for devices that
support IPsec session management.
====================
Signed-off-by: Steffen Klassert <[email protected]>
Diffstat (limited to 'net/xfrm/xfrm_user.c')
| -rw-r--r-- | net/xfrm/xfrm_user.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 0a3d3f3ae5a3..ae8e06573639 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -3069,6 +3069,7 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, int n = 0; struct net *net = sock_net(skb->sk); struct xfrm_encap_tmpl *encap = NULL; + struct xfrm_user_offload *xuo = NULL; u32 if_id = 0; if (!attrs[XFRMA_MIGRATE]) { @@ -3099,11 +3100,19 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, if (attrs[XFRMA_IF_ID]) if_id = nla_get_u32(attrs[XFRMA_IF_ID]); + if (attrs[XFRMA_OFFLOAD_DEV]) { + xuo = kmemdup(nla_data(attrs[XFRMA_OFFLOAD_DEV]), + sizeof(*xuo), GFP_KERNEL); + if (!xuo) { + err = -ENOMEM; + goto error; + } + } err = xfrm_migrate(&pi->sel, pi->dir, type, m, n, kmp, net, encap, - if_id, extack); - + if_id, extack, xuo); +error: kfree(encap); - + kfree(xuo); return err; } #else |
