]> err.no Git - linux-2.6/blobdiff - net/ipv6/ipv6_sockglue.c
[IPV6]: Sparse: Reuse previous delaration where appropriate.
[linux-2.6] / net / ipv6 / ipv6_sockglue.c
index d3d93d752e1099c43cfa1e33adfa15630463df7f..bf96953752199ef42de94779f2d4d6050c25b21f 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/sockios.h>
 #include <linux/net.h>
 #include <linux/in6.h>
+#include <linux/mroute6.h>
 #include <linux/netdevice.h>
 #include <linux/if_arp.h>
 #include <linux/init.h>
@@ -118,6 +119,9 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
 
        valbool = (val!=0);
 
+       if (ip6_mroute_opt(optname))
+               return ip6_mroute_setsockopt(sk, optname, optval, optlen);
+
        lock_sock(sk);
 
        switch (optname) {
@@ -155,10 +159,9 @@ 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);
-
                                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;
@@ -171,8 +174,8 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
                                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;
@@ -788,6 +791,9 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
        int len;
        int val;
 
+       if (ip6_mroute_opt(optname))
+               return ip6_mroute_getsockopt(sk, optname, optval, optlen);
+
        if (get_user(len, optlen))
                return -EFAULT;
        switch (optname) {