diff options
author | ru <ru@FreeBSD.org> | 2006-09-27 19:57:02 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2006-09-27 19:57:02 +0000 |
commit | 4ef62e4ca582414062d69e20a1ccdade4a110938 (patch) | |
tree | a886251dab8c19f71a5bfd0199ec1d9b327b3513 /sys/net/if_tap.c | |
parent | f6b387ce531fb4ba91958db5aadcb53f89d4ed1b (diff) | |
download | FreeBSD-src-4ef62e4ca582414062d69e20a1ccdade4a110938.zip FreeBSD-src-4ef62e4ca582414062d69e20a1ccdade4a110938.tar.gz |
Fix our ioctl(2) implementation when the argument is "int". New
ioctls passing integer arguments should use the _IOWINT() macro.
This fixes a lot of ioctl's not working on sparc64, most notable
being keyboard/syscons ioctls.
Full ABI compatibility is provided, with the bonus of fixing the
handling of old ioctls on sparc64.
Reviewed by: bde (with contributions)
Tested by: emax, marius
MFC after: 1 week
Diffstat (limited to 'sys/net/if_tap.c')
-rw-r--r-- | sys/net/if_tap.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c index dd40cde..1f0ed89 100644 --- a/sys/net/if_tap.c +++ b/sys/net/if_tap.c @@ -35,6 +35,7 @@ * $Id: if_tap.c,v 0.21 2000/07/23 21:46:02 max Exp $ */ +#include "opt_compat.h" #include "opt_inet.h" #include <sys/param.h> @@ -612,6 +613,10 @@ tapioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td struct tapinfo *tapp = NULL; int s; int f; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) + int ival; +#endif switch (cmd) { case TAPSIFINFO: @@ -686,8 +691,15 @@ tapioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td bcopy(&ifp->if_flags, data, sizeof(ifp->if_flags)); break; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) + case _IO('V', 0): + ival = IOCPARM_IVAL(data); + data = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif case VMIO_SIOCSIFFLAGS: /* VMware/VMnet SIOCSIFFLAGS */ - f = *(intptr_t *)data; + f = *(int *)data; f &= 0x0fff; f &= ~IFF_CANTCHANGE; f |= IFF_UP; |