netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: spereira@tusc.com.au
Cc: linux-kenel <linux-kernel@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>, Andi Kleen <ak@muc.de>,
	SP <pereira.shaun@gmail.com>
Subject: Re: [PATCH] net: 32 bit (socket layer) ioctl emulation for 64 bit kernels
Date: Wed, 11 Jan 2006 12:52:39 +0000	[thread overview]
Message-ID: <200601111252.39897.arnd@arndb.de> (raw)
In-Reply-To: <1136960915.5347.10.camel@spereira05.tusc.com.au>

On Wednesday 11 January 2006 06:28, Shaun Pereira wrote:
> And the correct x.25 patch, (will build a [PATCH] if this is ok).
> Tested with with xot to a Cisco box. 

Much better now, but

> +       switch(cmd) {
> +               case TIOCOUTQ:
> +               case TIOCINQ:

Looking at how these are handled in x25_ioctl(),
these should be forwarded to x25_ioctl(), because they are
compatible. With your current code you incorrectly return -EINVAL.

> +               case SIOCGSTAMP:

This one actually needs a conversion handler. You could
add a generic compat_sock_get_timestamp() function to net/compat.c
for this.

> +               case SIOCGIFADDR:
> +               case SIOCSIFADDR:
> +               case SIOCGIFDSTADDR:
> +               case SIOCSIFDSTADDR:
> +               case SIOCGIFBRDADDR:
> +               case SIOCSIFBRDADDR:
> +               case SIOCGIFNETMASK:
> +               case SIOCSIFNETMASK:
> +               case SIOCGIFMETRIC:
> +               case SIOCSIFMETRIC:

These all return -EINVAL in x25_ioctl, just do the same here.

For any the cases above, you can also choose not to handle them
in compat_x25_ioctl at all and just return -ENOIOCTLCMD, so they
get forwarded to the conversion code in fs/compat_ioctl.c. 

> +               case SIOCADDRT:
> +               case SIOCDELRT:

These should call x25_route_ioctl() instead of falling through to
to compat_x25_subscr_ioctl(), right?

> +               case SIOCX25GFACILITIES:
> +               case SIOCX25SFACILITIES:
> +               case SIOCX25GCALLUSERDATA:
> +               case SIOCX25SCALLUSERDATA:
> +               case SIOCX25GCAUSEDIAG:
> +               case SIOCX25SCUDMATCHLEN:
> +               case SIOCX25CALLACCPTAPPRV:
> +                       rc = x25_ioctl(sock, cmd, (unsigned long)argp);
> +                       break;
> +               case SIOCX25SENDCALLACCPT:
> +                       rc = x25_ioctl(sock, cmd, (unsigned long)argp);
> +                       break;

I guess these can be combined to a single case list.

        Arnd <><

      reply	other threads:[~2006-01-11 12:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-09  6:46 [PATCH] net: 32 bit (socket layer) ioctl emulation for 64 bit kernels Shaun Pereira
2006-01-09 10:54 ` Arnd Bergmann
2006-01-09 11:31   ` Arnaldo Carvalho de Melo
2006-01-11  6:28   ` Shaun Pereira
2006-01-11 12:52     ` Arnd Bergmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200601111252.39897.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=ak@muc.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pereira.shaun@gmail.com \
    --cc=spereira@tusc.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).