Merge branch 'rmobile-fixes-for-linus' of git://github.com/pmundt/linux-sh
[pandora-kernel.git] / net / ipv6 / ipv6_sockglue.c
index 2fbda5f..26cb08c 100644 (file)
@@ -343,7 +343,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
                break;
 
        case IPV6_TRANSPARENT:
-               if (!capable(CAP_NET_ADMIN)) {
+               if (valbool && !capable(CAP_NET_ADMIN) && !capable(CAP_NET_RAW)) {
                        retv = -EPERM;
                        break;
                }
@@ -503,7 +503,7 @@ done:
                        goto e_inval;
                if (val > 255 || val < -1)
                        goto e_inval;
-               np->mcast_hops = val;
+               np->mcast_hops = (val == -1 ? IPV6_DEFAULT_MCASTHOPS : val);
                retv = 0;
                break;