aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2006-03-21 01:46:16 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-21 01:46:16 -0500
commitdec73ff0293d59076d1fd8f4a264898ecfc457ec (patch)
tree251a87b4b98d073fcd3753e01eea5ea44aaf9570 /net/ipv4/tcp.c
parentd1d47beef8ecaeedc368f00780d02cfa5e540005 (diff)
[ICSK] compat: Introduce inet_csk_compat_[gs]etsockopt
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 31b0123a9699..89da253e33f0 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1882,16 +1882,9 @@ int tcp_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
1882int compat_tcp_setsockopt(struct sock *sk, int level, 1882int compat_tcp_setsockopt(struct sock *sk, int level,
1883 int optname, char __user *optval, int optlen) 1883 int optname, char __user *optval, int optlen)
1884{ 1884{
1885 struct inet_connection_sock *icsk = inet_csk(sk); 1885 if (level != SOL_TCP)
1886 1886 return inet_csk_compat_setsockopt(sk, level, optname,
1887 if (level != SOL_TCP) { 1887 optval, optlen);
1888 if (icsk->icsk_af_ops->compat_setsockopt)
1889 return icsk->icsk_af_ops->compat_setsockopt(sk,
1890 level, optname, optval, optlen);
1891 else
1892 return icsk->icsk_af_ops->setsockopt(sk,
1893 level, optname, optval, optlen);
1894 }
1895 return do_tcp_setsockopt(sk, level, optname, optval, optlen); 1888 return do_tcp_setsockopt(sk, level, optname, optval, optlen);
1896} 1889}
1897#endif 1890#endif
@@ -2061,16 +2054,9 @@ int tcp_getsockopt(struct sock *sk, int level, int optname, char __user *optval,
2061int compat_tcp_getsockopt(struct sock *sk, int level, 2054int compat_tcp_getsockopt(struct sock *sk, int level,
2062 int optname, char __user *optval, int __user *optlen) 2055 int optname, char __user *optval, int __user *optlen)
2063{ 2056{
2064 struct inet_connection_sock *icsk = inet_csk(sk); 2057 if (level != SOL_TCP)
2065 2058 return inet_csk_compat_getsockopt(sk, level, optname,
2066 if (level != SOL_TCP) { 2059 optval, optlen);
2067 if (icsk->icsk_af_ops->compat_getsockopt)
2068 return icsk->icsk_af_ops->compat_getsockopt(sk,
2069 level, optname, optval, optlen);
2070 else
2071 return icsk->icsk_af_ops->getsockopt(sk,
2072 level, optname, optval, optlen);
2073 }
2074 return do_tcp_getsockopt(sk, level, optname, optval, optlen); 2060 return do_tcp_getsockopt(sk, level, optname, optval, optlen);
2075} 2061}
2076#endif 2062#endif