Commit 44fbe3d2 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Emulate deviceless bridge ioctls

This helps vmware users running vmware on x86-64 - vmnet tries to set up a bridge.
Emulate these ioctls. The bridge has more ioctls on its bridge device, but these
don't seem to be needed here.
parent 2b82353a
...@@ -3070,6 +3070,20 @@ static int do_wireless_ioctl(unsigned int fd, unsigned int cmd, unsigned long ar ...@@ -3070,6 +3070,20 @@ static int do_wireless_ioctl(unsigned int fd, unsigned int cmd, unsigned long ar
return sys_ioctl(fd, cmd, (unsigned long) iwr); return sys_ioctl(fd, cmd, (unsigned long) iwr);
} }
/* Emulate old style bridge ioctls */
static int do_bridge_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
{
u32 tmp;
unsigned long *argbuf = compat_alloc_user_space(3 * sizeof(unsigned long));
int i;
for (i = 0; i < 3; i++) {
if (get_user(tmp, i + ((u32 *)arg)) ||
put_user(tmp, i + argbuf))
return -EFAULT;
}
return sys_ioctl(fd, cmd, (unsigned long)argbuf);
}
#undef CODE #undef CODE
#endif #endif
...@@ -3247,6 +3261,8 @@ HANDLE_IOCTL(SIOCSIWNICKN, do_wireless_ioctl) ...@@ -3247,6 +3261,8 @@ HANDLE_IOCTL(SIOCSIWNICKN, do_wireless_ioctl)
HANDLE_IOCTL(SIOCGIWNICKN, do_wireless_ioctl) HANDLE_IOCTL(SIOCGIWNICKN, do_wireless_ioctl)
HANDLE_IOCTL(SIOCSIWENCODE, do_wireless_ioctl) HANDLE_IOCTL(SIOCSIWENCODE, do_wireless_ioctl)
HANDLE_IOCTL(SIOCGIWENCODE, do_wireless_ioctl) HANDLE_IOCTL(SIOCGIWENCODE, do_wireless_ioctl)
HANDLE_IOCTL(SIOCSIFBR, do_bridge_ioctl)
HANDLE_IOCTL(SIOCGIFBR, do_bridge_ioctl)
#undef DECLARES #undef DECLARES
#endif #endif
...@@ -248,10 +248,6 @@ COMPATIBLE_IOCTL(SIOCSIFLINK) ...@@ -248,10 +248,6 @@ COMPATIBLE_IOCTL(SIOCSIFLINK)
COMPATIBLE_IOCTL(SIOCSIFENCAP) COMPATIBLE_IOCTL(SIOCSIFENCAP)
COMPATIBLE_IOCTL(SIOCGIFENCAP) COMPATIBLE_IOCTL(SIOCGIFENCAP)
COMPATIBLE_IOCTL(SIOCSIFNAME) COMPATIBLE_IOCTL(SIOCSIFNAME)
/* FIXME: not compatible
COMPATIBLE_IOCTL(SIOCSIFBR)
COMPATIBLE_IOCTL(SIOCGIFBR)
*/
COMPATIBLE_IOCTL(SIOCSARP) COMPATIBLE_IOCTL(SIOCSARP)
COMPATIBLE_IOCTL(SIOCGARP) COMPATIBLE_IOCTL(SIOCGARP)
COMPATIBLE_IOCTL(SIOCDARP) COMPATIBLE_IOCTL(SIOCDARP)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment