From fa67ebf9bb73ba28afcf1fa97b074651db372ace Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Tue, 30 May 2006 20:08:12 +0000 Subject: [PATCH] Revert the (int *) -> (intptr_t *) conversion done as part of rev. 1.59 for IOCTLs where casting data to intptr_t * isn't the right thing to do as _IO() isn't used for them but _IOR(..., int)/_IOW(..., int) are (i.e. for all IOCTLs except VMIO_SIOCSIFFLAGS), fixing tap(4) on big-endian LP64 machines. PR: sparc64/98084 OK'ed by: emax MFC after: 1 week --- sys/net/if_tap.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c index 78baf035080c..a317f0af3d87 100644 --- a/sys/net/if_tap.c +++ b/sys/net/if_tap.c @@ -631,11 +631,11 @@ tapioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td break; case TAPSDEBUG: - tapdebug = *(intptr_t *)data; + tapdebug = *(int *)data; break; case TAPGDEBUG: - *(intptr_t *)data = tapdebug; + *(int *)data = tapdebug; break; case FIONBIO: @@ -644,7 +644,7 @@ tapioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td case FIOASYNC: s = splimp(); mtx_lock(&tp->tap_mtx); - if (*(intptr_t *)data) + if (*(int *)data) tp->tap_flags |= TAP_ASYNC; else tp->tap_flags &= ~TAP_ASYNC; @@ -657,27 +657,27 @@ tapioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td if (ifp->if_snd.ifq_head) { struct mbuf *mb = ifp->if_snd.ifq_head; - for(*(intptr_t *)data = 0;mb != NULL;mb = mb->m_next) - *(intptr_t *)data += mb->m_len; + for(*(int *)data = 0;mb != NULL;mb = mb->m_next) + *(int *)data += mb->m_len; } else - *(intptr_t *)data = 0; + *(int *)data = 0; splx(s); break; case FIOSETOWN: - return (fsetown(*(intptr_t *)data, &tp->tap_sigio)); + return (fsetown(*(int *)data, &tp->tap_sigio)); case FIOGETOWN: - *(intptr_t *)data = fgetown(&tp->tap_sigio); + *(int *)data = fgetown(&tp->tap_sigio); return (0); /* this is deprecated, FIOSETOWN should be used instead */ case TIOCSPGRP: - return (fsetown(-(*(intptr_t *)data), &tp->tap_sigio)); + return (fsetown(-(*(int *)data), &tp->tap_sigio)); /* this is deprecated, FIOGETOWN should be used instead */ case TIOCGPGRP: - *(intptr_t *)data = -fgetown(&tp->tap_sigio); + *(int *)data = -fgetown(&tp->tap_sigio); return (0); /* VMware/VMnet port ioctl's */