]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/ipv6/ipv6_sockglue.c
[IPV6] SIT: Disallow 0.0.0.0 in PRL and Flush PRL if given for DEL.
[mv-sheeva.git] / net / ipv6 / ipv6_sockglue.c
index dc6695cc5767a140722e2ee46f4ed5df52d4f0b9..4195ac92345e84f6a060fee53fa0d0274df36471 100644 (file)
@@ -107,7 +107,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
                    char __user *optval, int optlen)
 {
        struct ipv6_pinfo *np = inet6_sk(sk);
-       struct net *net = sk->sk_net;
+       struct net *net = sock_net(sk);
        int val, valbool;
        int retv = -ENOPROTOOPT;
 
@@ -155,10 +155,11 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
 
                        if (sk->sk_protocol == IPPROTO_TCP) {
                                struct inet_connection_sock *icsk = inet_csk(sk);
+                               struct net *net = sock_net(sk);
 
                                local_bh_disable();
-                               sock_prot_inuse_add(sk->sk_prot, -1);
-                               sock_prot_inuse_add(&tcp_prot, 1);
+                               sock_prot_inuse_add(net, sk->sk_prot, -1);
+                               sock_prot_inuse_add(net, &tcp_prot, 1);
                                local_bh_enable();
                                sk->sk_prot = &tcp_prot;
                                icsk->icsk_af_ops = &ipv4_specific;
@@ -167,12 +168,13 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
                                tcp_sync_mss(sk, icsk->icsk_pmtu_cookie);
                        } else {
                                struct proto *prot = &udp_prot;
+                               struct net *net = sock_net(sk);
 
                                if (sk->sk_protocol == IPPROTO_UDPLITE)
                                        prot = &udplite_prot;
                                local_bh_disable();
-                               sock_prot_inuse_add(sk->sk_prot, -1);
-                               sock_prot_inuse_add(prot, 1);
+                               sock_prot_inuse_add(net, sk->sk_prot, -1);
+                               sock_prot_inuse_add(net, prot, 1);
                                local_bh_enable();
                                sk->sk_prot = prot;
                                sk->sk_socket->ops = &inet_dgram_ops;