diff options
author | Alexander Lobakin <aleksander.lobakin@intel.com> | 2024-03-27 16:23:52 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-04-01 11:49:28 +0200 |
commit | 117aef12a7b1b797bce9f66b156c65eab850b5b5 (patch) | |
tree | 8f5186e9ab168c13efd543f98933afa7b4cf26ec /net/ipv4/ip_tunnel_core.c | |
parent | lib/bitmap: add compile-time test for __assign_bit() optimization (diff) | |
download | linux-117aef12a7b1b797bce9f66b156c65eab850b5b5.tar.xz linux-117aef12a7b1b797bce9f66b156c65eab850b5b5.zip |
ip_tunnel: use a separate struct to store tunnel params in the kernel
Unlike IPv6 tunnels which use purely-kernel __ip6_tnl_parm structure
to store params inside the kernel, IPv4 tunnel code uses the same
ip_tunnel_parm which is being used to talk with the userspace.
This makes it difficult to alter or add any fields or use a
different format for whatever data.
Define struct ip_tunnel_parm_kern, a 1:1 copy of ip_tunnel_parm for
now, and use it throughout the code. Define the pieces, where the copy
user <-> kernel happens, as standalone functions, and copy the data
there field-by-field, so that the kernel-side structure could be easily
modified later on and the users wouldn't have to care about this.
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_tunnel_core.c')
-rw-r--r-- | net/ipv4/ip_tunnel_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c index 80ccd6661aa3..98f136b07191 100644 --- a/net/ipv4/ip_tunnel_core.c +++ b/net/ipv4/ip_tunnel_core.c @@ -1116,7 +1116,7 @@ bool ip_tunnel_netlink_encap_parms(struct nlattr *data[], EXPORT_SYMBOL_GPL(ip_tunnel_netlink_encap_parms); void ip_tunnel_netlink_parms(struct nlattr *data[], - struct ip_tunnel_parm *parms) + struct ip_tunnel_parm_kern *parms) { if (data[IFLA_IPTUN_LINK]) parms->link = nla_get_u32(data[IFLA_IPTUN_LINK]); |