]> Git Repo - linux.git/blobdiff - net/ipv6/anycast.c
net: Allow userns root to control ipv6
[linux.git] / net / ipv6 / anycast.c
index cdf02be5f191405de1587f4d03b3c12f3fe4cc9d..2f4f584d796dd3f27a7c580621bea4035ea1728f 100644 (file)
@@ -64,7 +64,7 @@ int ipv6_sock_ac_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
        int     ishost = !net->ipv6.devconf_all->forwarding;
        int     err = 0;
 
-       if (!capable(CAP_NET_ADMIN))
+       if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
                return -EPERM;
        if (ipv6_addr_is_multicast(addr))
                return -EINVAL;
@@ -84,7 +84,7 @@ int ipv6_sock_ac_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
                rt = rt6_lookup(net, addr, NULL, 0, 0);
                if (rt) {
                        dev = rt->dst.dev;
-                       dst_release(&rt->dst);
+                       ip6_rt_put(rt);
                } else if (ishost) {
                        err = -EADDRNOTAVAIL;
                        goto error;
This page took 0.032966 seconds and 4 git commands to generate.