net, compat_ioctl: fix SIOCGMII ioctls
authorArnd Bergmann <arnd@arndb.de>
Mon, 9 Nov 2009 04:56:21 +0000 (20:56 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Nov 2009 04:56:21 +0000 (20:56 -0800)
SIOCGMIIPHY and SIOCGMIIREG return data through ifreq,
so it needs to be converted on the way out as well.

SIOCGIFPFLAGS is unused, but has the same problem in theory.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/socket.c

index bfbde200b743ac863595c4096e594b08ef5de425..224e7f73fdf0c93721135c5d9960ae75561f3126 100644 (file)
@@ -2746,7 +2746,10 @@ static int dev_ifsioc(struct net *net, struct socket *sock,
                case SIOCGIFBRDADDR:
                case SIOCGIFDSTADDR:
                case SIOCGIFNETMASK:
+               case SIOCGIFPFLAGS:
                case SIOCGIFTXQLEN:
+               case SIOCGMIIPHY:
+               case SIOCGMIIREG:
                        if (copy_to_user(uifr32, &ifr, sizeof(*uifr32)))
                                return -EFAULT;
                        break;