Re: [PATCH] net: 32 bit (socket layer) ioctl emulation for 64 bit kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <><
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux