diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2006-03-21 01:48:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-21 01:48:35 -0500 |
commit | 543d9cfeec4d58ad3fd974db5531b06b6b95deb4 (patch) | |
tree | b5f79a92ec01b4a97f26d48cae11566498641822 /net/ipv4/ip_sockglue.c | |
parent | f94691acf9df35d5cd828373e35391bdc4a3fde6 (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/ipv4/ip_sockglue.c')
-rw-r--r-- | net/ipv4/ip_sockglue.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 49ff1cd4e1c9..12e0bf19f24a 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -910,8 +910,8 @@ int ip_setsockopt(struct sock *sk, int level, | |||
910 | } | 910 | } |
911 | 911 | ||
912 | #ifdef CONFIG_COMPAT | 912 | #ifdef CONFIG_COMPAT |
913 | int compat_ip_setsockopt(struct sock *sk, int level, | 913 | int compat_ip_setsockopt(struct sock *sk, int level, int optname, |
914 | int optname, char __user *optval, int optlen) | 914 | char __user *optval, int optlen) |
915 | { | 915 | { |
916 | int err; | 916 | int err; |
917 | 917 | ||
@@ -922,19 +922,21 @@ int compat_ip_setsockopt(struct sock *sk, int level, | |||
922 | #ifdef CONFIG_NETFILTER | 922 | #ifdef CONFIG_NETFILTER |
923 | /* we need to exclude all possible ENOPROTOOPTs except default case */ | 923 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
924 | if (err == -ENOPROTOOPT && optname != IP_HDRINCL && | 924 | if (err == -ENOPROTOOPT && optname != IP_HDRINCL && |
925 | optname != IP_IPSEC_POLICY && optname != IP_XFRM_POLICY | 925 | optname != IP_IPSEC_POLICY && optname != IP_XFRM_POLICY |
926 | #ifdef CONFIG_IP_MROUTE | 926 | #ifdef CONFIG_IP_MROUTE |
927 | && (optname < MRT_BASE || optname > (MRT_BASE + 10)) | 927 | && (optname < MRT_BASE || optname > (MRT_BASE + 10)) |
928 | #endif | 928 | #endif |
929 | ) { | 929 | ) { |
930 | lock_sock(sk); | 930 | lock_sock(sk); |
931 | err = compat_nf_setsockopt(sk, PF_INET, | 931 | err = compat_nf_setsockopt(sk, PF_INET, optname, |
932 | optname, optval, optlen); | 932 | optval, optlen); |
933 | release_sock(sk); | 933 | release_sock(sk); |
934 | } | 934 | } |
935 | #endif | 935 | #endif |
936 | return err; | 936 | return err; |
937 | } | 937 | } |
938 | |||
939 | EXPORT_SYMBOL(compat_ip_setsockopt); | ||
938 | #endif | 940 | #endif |
939 | 941 | ||
940 | /* | 942 | /* |
@@ -1180,27 +1182,24 @@ int ip_getsockopt(struct sock *sk, int level, | |||
1180 | } | 1182 | } |
1181 | 1183 | ||
1182 | #ifdef CONFIG_COMPAT | 1184 | #ifdef CONFIG_COMPAT |
1183 | int compat_ip_getsockopt(struct sock *sk, int level, | 1185 | int compat_ip_getsockopt(struct sock *sk, int level, int optname, |
1184 | int optname, char __user *optval, int __user *optlen) | 1186 | char __user *optval, int __user *optlen) |
1185 | { | 1187 | { |
1186 | int err; | 1188 | int err = do_ip_getsockopt(sk, level, optname, optval, optlen); |
1187 | |||
1188 | err = do_ip_getsockopt(sk, level, optname, optval, optlen); | ||
1189 | #ifdef CONFIG_NETFILTER | 1189 | #ifdef CONFIG_NETFILTER |
1190 | /* we need to exclude all possible ENOPROTOOPTs except default case */ | 1190 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
1191 | if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS | 1191 | if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS |
1192 | #ifdef CONFIG_IP_MROUTE | 1192 | #ifdef CONFIG_IP_MROUTE |
1193 | && (optname < MRT_BASE || optname > MRT_BASE+10) | 1193 | && (optname < MRT_BASE || optname > MRT_BASE+10) |
1194 | #endif | 1194 | #endif |
1195 | ) { | 1195 | ) { |
1196 | int len; | 1196 | int len; |
1197 | 1197 | ||
1198 | if(get_user(len,optlen)) | 1198 | if (get_user(len, optlen)) |
1199 | return -EFAULT; | 1199 | return -EFAULT; |
1200 | 1200 | ||
1201 | lock_sock(sk); | 1201 | lock_sock(sk); |
1202 | err = compat_nf_getsockopt(sk, PF_INET, | 1202 | err = compat_nf_getsockopt(sk, PF_INET, optname, optval, &len); |
1203 | optname, optval, &len); | ||
1204 | release_sock(sk); | 1203 | release_sock(sk); |
1205 | if (err >= 0) | 1204 | if (err >= 0) |
1206 | err = put_user(len, optlen); | 1205 | err = put_user(len, optlen); |
@@ -1209,13 +1208,11 @@ int compat_ip_getsockopt(struct sock *sk, int level, | |||
1209 | #endif | 1208 | #endif |
1210 | return err; | 1209 | return err; |
1211 | } | 1210 | } |
1211 | |||
1212 | EXPORT_SYMBOL(compat_ip_getsockopt); | ||
1212 | #endif | 1213 | #endif |
1213 | 1214 | ||
1214 | EXPORT_SYMBOL(ip_cmsg_recv); | 1215 | EXPORT_SYMBOL(ip_cmsg_recv); |
1215 | 1216 | ||
1216 | EXPORT_SYMBOL(ip_getsockopt); | 1217 | EXPORT_SYMBOL(ip_getsockopt); |
1217 | EXPORT_SYMBOL(ip_setsockopt); | 1218 | EXPORT_SYMBOL(ip_setsockopt); |
1218 | #ifdef CONFIG_COMPAT | ||
1219 | EXPORT_SYMBOL(compat_ip_getsockopt); | ||
1220 | EXPORT_SYMBOL(compat_ip_setsockopt); | ||
1221 | #endif | ||