summaryrefslogtreecommitdiffstats
path: root/sys/net/if_tun.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
committerjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
commit5596676e6c6c1e81e899cd0531f9b1c28a292669 (patch)
treeb1a19fcdf05759281fab0d89efb13f0fdf42102e /sys/net/if_tun.c
parent83e00d4274950d2b531c24692cd123538ffbddb9 (diff)
downloadFreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.zip
FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.tar.gz
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r--sys/net/if_tun.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 1e6f19b..92bf7f6 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -259,7 +259,7 @@ tuncreate(dev_t dev)
}
static int
-tunopen(dev_t dev, int flag, int mode, struct proc *p)
+tunopen(dev_t dev, int flag, int mode, struct thread *td)
{
struct resource *r;
struct ifnet *ifp;
@@ -284,7 +284,7 @@ tunopen(dev_t dev, int flag, int mode, struct proc *p)
}
KASSERT(!(tp->tun_flags & TUN_OPEN), ("Resource & flags out-of-sync"));
tp->r_unit = r;
- tp->tun_pid = p->p_pid;
+ tp->tun_pid = td->td_proc->p_pid;
ifp = &tp->tun_if;
tp->tun_flags |= TUN_OPEN;
TUNDEBUG("%s%d: open\n", ifp->if_name, ifp->if_unit);
@@ -297,7 +297,7 @@ tunopen(dev_t dev, int flag, int mode, struct proc *p)
* routing info
*/
static int
-tunclose(dev_t dev, int foo, int bar, struct proc *p)
+tunclose(dev_t dev, int foo, int bar, struct thread *td)
{
struct tun_softc *tp;
struct ifnet *ifp;
@@ -520,7 +520,7 @@ tunoutput(
* the cdevsw interface is now pretty minimal.
*/
static int
-tunioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
+tunioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
int s;
int error;
@@ -532,7 +532,8 @@ tunioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
tunp = (struct tuninfo *)data;
if (tunp->mtu < IF_MINMTU)
return (EINVAL);
- if (tp->tun_if.if_mtu != tunp->mtu && (error = suser(p)) != 0)
+ if (tp->tun_if.if_mtu != tunp->mtu
+ && (error = suser_td(td)) != 0)
return (error);
tp->tun_if.if_mtu = tunp->mtu;
tp->tun_if.if_type = tunp->type;
@@ -584,7 +585,7 @@ tunioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
}
break;
case TUNSIFPID:
- tp->tun_pid = curproc->p_pid;
+ tp->tun_pid = curthread->td_proc->p_pid;
break;
case FIONBIO:
break;
@@ -790,7 +791,7 @@ tunwrite(dev_t dev, struct uio *uio, int flag)
* anyway, it either accepts the packet or drops it.
*/
static int
-tunpoll(dev_t dev, int events, struct proc *p)
+tunpoll(dev_t dev, int events, struct thread *td)
{
int s;
struct tun_softc *tp = dev->si_drv1;
@@ -808,7 +809,7 @@ tunpoll(dev_t dev, int events, struct proc *p)
} else {
TUNDEBUG("%s%d: tunpoll waiting\n", ifp->if_name,
ifp->if_unit);
- selrecord(p, &tp->tun_rsel);
+ selrecord(curthread, &tp->tun_rsel);
}
}
if (events & (POLLOUT | POLLWRNORM))
OpenPOWER on IntegriCloud