]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv6/ipv6_sockglue.c
[NET]: Make the device list and device lookups per namespace.
[linux-2.6-omap-h63xx.git] / net / ipv6 / ipv6_sockglue.c
index aa3d07c52a8fd18d44361d4a6f5fa2fd2d5c1612..eb330a44bacdf48d3fd03b720d4d33347bd3b016 100644 (file)
@@ -123,7 +123,7 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, int features)
        struct ipv6hdr *ipv6h;
        struct inet6_protocol *ops;
 
-       if (!(features & NETIF_F_HW_CSUM))
+       if (!(features & NETIF_F_V6_CSUM))
                features &= ~NETIF_F_SG;
 
        if (unlikely(skb_shinfo(skb)->gso_type &
@@ -249,7 +249,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
                        }
 
                        if (ipv6_only_sock(sk) ||
-                           !(ipv6_addr_type(&np->daddr) & IPV6_ADDR_MAPPED)) {
+                           !ipv6_addr_v4mapped(&np->daddr)) {
                                retv = -EADDRNOTAVAIL;
                                break;
                        }
@@ -336,16 +336,12 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
                break;
 
        case IPV6_RECVRTHDR:
-               if (val < 0 || val > 2)
-                       goto e_inval;
-               np->rxopt.bits.srcrt = val;
+               np->rxopt.bits.srcrt = valbool;
                retv = 0;
                break;
 
        case IPV6_2292RTHDR:
-               if (val < 0 || val > 2)
-                       goto e_inval;
-               np->rxopt.bits.osrcrt = val;
+               np->rxopt.bits.osrcrt = valbool;
                retv = 0;
                break;
 
@@ -416,11 +412,10 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
                if (optname == IPV6_RTHDR && opt && opt->srcrt) {
                        struct ipv6_rt_hdr *rthdr = opt->srcrt;
                        switch (rthdr->type) {
-                       case IPV6_SRCRT_TYPE_0:
-#ifdef CONFIG_IPV6_MIP6
+#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
                        case IPV6_SRCRT_TYPE_2:
-#endif
                                break;
+#endif
                        default:
                                goto sticky_done;
                        }
@@ -547,7 +542,7 @@ done:
                if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != val)
                        goto e_inval;
 
-               if (__dev_get_by_index(val) == NULL) {
+               if (__dev_get_by_index(&init_net, val) == NULL) {
                        retv = -ENODEV;
                        break;
                }
@@ -559,6 +554,10 @@ done:
        {
                struct ipv6_mreq mreq;
 
+               retv = -EPROTO;
+               if (inet_sk(sk)->is_icsk)
+                       break;
+
                retv = -EFAULT;
                if (copy_from_user(&mreq, optval, sizeof(struct ipv6_mreq)))
                        break;
@@ -825,7 +824,7 @@ static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt,
                return 0;
 
        len = min_t(unsigned int, len, ipv6_optlen(hdr));
-       if (copy_to_user(optval, hdr, len));
+       if (copy_to_user(optval, hdr, len))
                return -EFAULT;
        return ipv6_optlen(hdr);
 }