summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-05-28 07:12:31 +0200
committerDavid S. Miller <davem@davemloft.net>2020-05-28 11:11:45 -0700
commit9b115749acb24d11083ded4fe947ddd654a940e3 (patch)
tree8667571df0465bf10b1d72a641df77ac916dd773 /net/ipv6
parentc1f9ec5776dd05eaf62cf6788ecdfc905dc8ec2b (diff)
downloadlinux-9b115749acb24d11083ded4fe947ddd654a940e3.tar.gz
linux-9b115749acb24d11083ded4fe947ddd654a940e3.tar.bz2
linux-9b115749acb24d11083ded4fe947ddd654a940e3.zip
ipv6: add ip6_sock_set_v6only
Add a helper to directly set the IPV6_V6ONLY sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/ip6_udp_tunnel.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/ipv6/ip6_udp_tunnel.c b/net/ipv6/ip6_udp_tunnel.c
index 6523609516d2..2e0ad1bc84a8 100644
--- a/net/ipv6/ip6_udp_tunnel.c
+++ b/net/ipv6/ip6_udp_tunnel.c
@@ -25,10 +25,7 @@ int udp_sock_create6(struct net *net, struct udp_port_cfg *cfg,
goto error;
if (cfg->ipv6_v6only) {
- int val = 1;
-
- err = kernel_setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY,
- (char *) &val, sizeof(val));
+ err = ip6_sock_set_v6only(sock->sk);
if (err < 0)
goto error;
}