]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/atm/svc.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke...
[karo-tx-linux.git] / net / atm / svc.c
index 8fb54dc870b393d61373e308dfa8bec722d591a5..f90d143c4b2592d6ed2145724d580911b9839c28 100644 (file)
@@ -446,7 +446,7 @@ int svc_change_qos(struct atm_vcc *vcc,struct atm_qos *qos)
 
 
 static int svc_setsockopt(struct socket *sock, int level, int optname,
-                         char __user *optval, int optlen)
+                         char __user *optval, unsigned int optlen)
 {
        struct sock *sk = sock->sk;
        struct atm_vcc *vcc = ATM_SD(sock);
@@ -608,6 +608,22 @@ static int svc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
        return error;
 }
 
+#ifdef CONFIG_COMPAT
+static int svc_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
+{
+       /* The definition of ATM_ADDPARTY uses the size of struct atm_iobuf.
+          But actually it takes a struct sockaddr_atmsvc, which doesn't need
+          compat handling. So all we have to do is fix up cmd... */
+       if (cmd == COMPAT_ATM_ADDPARTY)
+               cmd = ATM_ADDPARTY;
+
+       if (cmd == ATM_ADDPARTY || cmd == ATM_DROPPARTY)
+               return svc_ioctl(sock, cmd, arg);
+       else
+               return vcc_compat_ioctl(sock, cmd, arg);
+}
+#endif /* CONFIG_COMPAT */
+
 static const struct proto_ops svc_proto_ops = {
        .family =       PF_ATMSVC,
        .owner =        THIS_MODULE,
@@ -620,6 +636,9 @@ static const struct proto_ops svc_proto_ops = {
        .getname =      svc_getname,
        .poll =         vcc_poll,
        .ioctl =        svc_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl = svc_compat_ioctl,
+#endif
        .listen =       svc_listen,
        .shutdown =     svc_shutdown,
        .setsockopt =   svc_setsockopt,