diff options
author | Christoph Hellwig <hch@lst.de> | 2020-05-28 08:12:31 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-28 21:11:45 +0300 |
commit | 9b115749acb24d11083ded4fe947ddd654a940e3 (patch) | |
tree | 8667571df0465bf10b1d72a641df77ac916dd773 /net/ipv6/ip6_udp_tunnel.c | |
parent | c1f9ec5776dd05eaf62cf6788ecdfc905dc8ec2b (diff) |
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/ip6_udp_tunnel.c')
-rw-r--r-- | net/ipv6/ip6_udp_tunnel.c | 5 |
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; } |