aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ipv6_sockglue.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2006-03-21 01:48:35 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-21 01:48:35 -0500
commit543d9cfeec4d58ad3fd974db5531b06b6b95deb4 (patch)
treeb5f79a92ec01b4a97f26d48cae11566498641822 /net/ipv6/ipv6_sockglue.c
parentf94691acf9df35d5cd828373e35391bdc4a3fde6 (diff)
[NET]: Identation & other cleanups related to compat_[gs]etsockopt cset
No code changes, just tidying up, in some cases moving EXPORT_SYMBOLs to just after the function exported, etc. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ipv6_sockglue.c')
-rw-r--r--net/ipv6/ipv6_sockglue.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 988eac58e9d1..602feec47738 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -645,17 +645,15 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname,
645 645
646#ifdef CONFIG_COMPAT 646#ifdef CONFIG_COMPAT
647int compat_ipv6_setsockopt(struct sock *sk, int level, int optname, 647int compat_ipv6_setsockopt(struct sock *sk, int level, int optname,
648 char __user *optval, int optlen) 648 char __user *optval, int optlen)
649{ 649{
650 int err; 650 int err;
651 651
652 if (level == SOL_IP && sk->sk_type != SOCK_RAW) { 652 if (level == SOL_IP && sk->sk_type != SOCK_RAW) {
653 if (udp_prot.compat_setsockopt) 653 if (udp_prot.compat_setsockopt != NULL)
654 return udp_prot.compat_setsockopt(sk, level, 654 return udp_prot.compat_setsockopt(sk, level, optname,
655 optname, optval, optlen); 655 optval, optlen);
656 else 656 return udp_prot.setsockopt(sk, level, optname, optval, optlen);
657 return udp_prot.setsockopt(sk, level,
658 optname, optval, optlen);
659 } 657 }
660 658
661 if (level != SOL_IPV6) 659 if (level != SOL_IPV6)
@@ -665,15 +663,17 @@ int compat_ipv6_setsockopt(struct sock *sk, int level, int optname,
665#ifdef CONFIG_NETFILTER 663#ifdef CONFIG_NETFILTER
666 /* we need to exclude all possible ENOPROTOOPTs except default case */ 664 /* we need to exclude all possible ENOPROTOOPTs except default case */
667 if (err == -ENOPROTOOPT && optname != IPV6_IPSEC_POLICY && 665 if (err == -ENOPROTOOPT && optname != IPV6_IPSEC_POLICY &&
668 optname != IPV6_XFRM_POLICY) { 666 optname != IPV6_XFRM_POLICY) {
669 lock_sock(sk); 667 lock_sock(sk);
670 err = compat_nf_setsockopt(sk, PF_INET6, optname, optval, 668 err = compat_nf_setsockopt(sk, PF_INET6, optname,
671 optlen); 669 optval, optlen);
672 release_sock(sk); 670 release_sock(sk);
673 } 671 }
674#endif 672#endif
675 return err; 673 return err;
676} 674}
675
676EXPORT_SYMBOL(compat_ipv6_setsockopt);
677#endif 677#endif
678 678
679static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr, 679static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr,
@@ -927,20 +927,18 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname,
927 927
928#ifdef CONFIG_COMPAT 928#ifdef CONFIG_COMPAT
929int compat_ipv6_getsockopt(struct sock *sk, int level, int optname, 929int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,
930 char __user *optval, int __user *optlen) 930 char __user *optval, int __user *optlen)
931{ 931{
932 int err; 932 int err;
933 933
934 if (level == SOL_IP && sk->sk_type != SOCK_RAW) { 934 if (level == SOL_IP && sk->sk_type != SOCK_RAW) {
935 if (udp_prot.compat_getsockopt) 935 if (udp_prot.compat_getsockopt != NULL)
936 return udp_prot.compat_getsockopt(sk, level, 936 return udp_prot.compat_getsockopt(sk, level, optname,
937 optname, optval, optlen); 937 optval, optlen);
938 else 938 return udp_prot.getsockopt(sk, level, optname, optval, optlen);
939 return udp_prot.getsockopt(sk, level,
940 optname, optval, optlen);
941 } 939 }
942 940
943 if(level != SOL_IPV6) 941 if (level != SOL_IPV6)
944 return -ENOPROTOOPT; 942 return -ENOPROTOOPT;
945 943
946 err = do_ipv6_getsockopt(sk, level, optname, optval, optlen); 944 err = do_ipv6_getsockopt(sk, level, optname, optval, optlen);
@@ -954,8 +952,8 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,
954 return -EFAULT; 952 return -EFAULT;
955 953
956 lock_sock(sk); 954 lock_sock(sk);
957 err = compat_nf_getsockopt(sk, PF_INET6, optname, optval, 955 err = compat_nf_getsockopt(sk, PF_INET6,
958 &len); 956 optname, optval, &len);
959 release_sock(sk); 957 release_sock(sk);
960 if (err >= 0) 958 if (err >= 0)
961 err = put_user(len, optlen); 959 err = put_user(len, optlen);
@@ -963,6 +961,8 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,
963#endif 961#endif
964 return err; 962 return err;
965} 963}
964
965EXPORT_SYMBOL(compat_ipv6_getsockopt);
966#endif 966#endif
967 967
968void __init ipv6_packet_init(void) 968void __init ipv6_packet_init(void)