aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dst_metadata.h
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-02-20 13:17:21 -0800
committerJakub Kicinski <kuba@kernel.org>2025-02-20 13:17:21 -0800
commit372ab5a5feebb791663c7398fdf1cc541e2059ff (patch)
tree30cdabd37e083fa4cc0ec571e559b0c1a10081c4 /include/net/dst_metadata.h
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net (diff)
parentnet: Add options as a flexible array to struct ip_tunnel_info (diff)
downloadlinux-372ab5a5feebb791663c7398fdf1cc541e2059ff.tar.gz
linux-372ab5a5feebb791663c7398fdf1cc541e2059ff.zip
Merge branch 'flexible-array-for-ip-tunnel-options'
Gal Pressman says: ==================== Flexible array for ip tunnel options Remove the hidden assumption that options are allocated at the end of the struct, and teach the compiler about them using a flexible array. First patch is converting hard-coded 'info + 1' to use ip_tunnel_info() helper. Second patch adds the 'options' flexible array and changes the helper to use it. v4: https://lore.kernel.org/20250217202503.265318-1-gal@nvidia.com v3: https://lore.kernel.org/20250212140953.107533-1-gal@nvidia.com v2: https://lore.kernel.org/20250209101853.15828-1-gal@nvidia.com ==================== Link: https://patch.msgid.link/20250219143256.370277-1-gal@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/dst_metadata.h')
-rw-r--r--include/net/dst_metadata.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/include/net/dst_metadata.h b/include/net/dst_metadata.h
index 84c15402931c..4160731dcb6e 100644
--- a/include/net/dst_metadata.h
+++ b/include/net/dst_metadata.h
@@ -163,11 +163,8 @@ static inline struct metadata_dst *tun_dst_unclone(struct sk_buff *skb)
if (!new_md)
return ERR_PTR(-ENOMEM);
- unsafe_memcpy(&new_md->u.tun_info, &md_dst->u.tun_info,
- sizeof(struct ip_tunnel_info) + md_size,
- /* metadata_dst_alloc() reserves room (md_size bytes) for
- * options right after the ip_tunnel_info struct.
- */);
+ memcpy(&new_md->u.tun_info, &md_dst->u.tun_info,
+ sizeof(struct ip_tunnel_info) + md_size);
#ifdef CONFIG_DST_CACHE
/* Unclone the dst cache if there is one */
if (new_md->u.tun_info.dst_cache.cache) {