summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_sockglue.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-07-23 08:08:57 +0200
committerDavid S. Miller <davem@davemloft.net>2020-07-25 00:41:54 +0200
commitde40a3e88311b6f0fc79b876a4768bf2d99f9aae (patch)
tree003360e0a61ce0ad32f7071eaa3f53462f56764e /net/ipv4/ip_sockglue.c
parentnet/ipv4: switch ip_mroute_setsockopt to sockptr_t (diff)
downloadlinux-de40a3e88311b6f0fc79b876a4768bf2d99f9aae.tar.xz
linux-de40a3e88311b6f0fc79b876a4768bf2d99f9aae.zip
net/ipv4: merge ip_options_get and ip_options_get_from_user
Use the sockptr_t type to merge the versions. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_sockglue.c')
-rw-r--r--net/ipv4/ip_sockglue.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index ac495b0cff8f..b12f39b52008 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -280,7 +280,8 @@ int ip_cmsg_send(struct sock *sk, struct msghdr *msg, struct ipcm_cookie *ipc,
err = cmsg->cmsg_len - sizeof(struct cmsghdr);
/* Our caller is responsible for freeing ipc->opt */
- err = ip_options_get(net, &ipc->opt, CMSG_DATA(cmsg),
+ err = ip_options_get(net, &ipc->opt,
+ KERNEL_SOCKPTR(CMSG_DATA(cmsg)),
err < 40 ? err : 40);
if (err)
return err;
@@ -940,8 +941,8 @@ static int do_ip_setsockopt(struct sock *sk, int level,
if (optlen > 40)
goto e_inval;
- err = ip_options_get_from_user(sock_net(sk), &opt,
- optval, optlen);
+ err = ip_options_get(sock_net(sk), &opt, USER_SOCKPTR(optval),
+ optlen);
if (err)
break;
old = rcu_dereference_protected(inet->inet_opt,