]> git.baikalelectronics.ru Git - kernel.git/commit
net/tun: handle compat_ioctl directly
authorArnd Bergmann <arnd@arndb.de>
Sat, 7 Nov 2009 06:52:32 +0000 (22:52 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Nov 2009 06:52:32 +0000 (22:52 -0800)
commit501a2a4d4ce23e4a1ee77e88cf557e0ebc9c9c04
tree7b6d244ad6fa07ff199c7d1436750d535b6b8dcd
parenta9d07649554f4142994084dd21342d4ebe6fd9af
net/tun: handle compat_ioctl directly

The tun driver is the only code in the kernel that operates
on a character device with struct ifreq. Change the driver
to handle the conversion itself so we can contain the
remaining ifreq handling in the socket layer.

This also fixes a bug in the handling of invalid ioctl
numbers on an unbound tun device. The driver treats this
as a TUNSETIFF in native mode, but there is no way for
the generic compat_ioctl() function to emulate this
behaviour. Possibly the driver was only doing this
accidentally anyway, but if any code relies on this
misfeature, it now also works in compat mode.

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