[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>
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 59b2149..6d7aef9 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -522,14 +522,10 @@
 int compat_dccp_setsockopt(struct sock *sk, int level, int optname,
 		    char __user *optval, int optlen)
 {
-	if (level != SOL_DCCP) {
-		if (inet_csk(sk)->icsk_af_ops->compat_setsockopt)
-			return inet_csk(sk)->icsk_af_ops->compat_setsockopt(sk,
-				level, optname, optval, optlen);
-		else
-			return inet_csk(sk)->icsk_af_ops->setsockopt(sk,
-				level, optname, optval, optlen);
-	}
+	if (level != SOL_DCCP)
+		return inet_csk_compat_setsockopt(sk, level, optname,
+						  optval, optlen);
+
 	return do_dccp_setsockopt(sk, level, optname, optval, optlen);
 }
 EXPORT_SYMBOL_GPL(compat_dccp_setsockopt);
@@ -619,14 +615,9 @@
 int compat_dccp_getsockopt(struct sock *sk, int level, int optname,
 		    char __user *optval, int __user *optlen)
 {
-	if (level != SOL_DCCP) {
-		if (inet_csk(sk)->icsk_af_ops->compat_setsockopt)
-			return inet_csk(sk)->icsk_af_ops->compat_getsockopt(sk,
-				level, optname, optval, optlen);
-		else
-			return inet_csk(sk)->icsk_af_ops->getsockopt(sk,
-				level, optname, optval, optlen);
-	}
+	if (level != SOL_DCCP)
+		return inet_csk_compat_getsockopt(sk, level, optname,
+						  optval, optlen);
 	return do_dccp_getsockopt(sk, level, optname, optval, optlen);
 }
 EXPORT_SYMBOL_GPL(compat_dccp_getsockopt);