summaryrefslogtreecommitdiffstats
path: root/sys/net/if_ppp.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-04-01 21:31:13 +0000
committerjhb <jhb@FreeBSD.org>2002-04-01 21:31:13 +0000
commitdc2e474f79c1287592679cd5e0c4c2307feccd60 (patch)
tree79021f0d43a5858be317d5cd33eac8cd4962b336 /sys/net/if_ppp.c
parent34c7d606c9818987384d404948ecdc98521462bd (diff)
downloadFreeBSD-src-dc2e474f79c1287592679cd5e0c4c2307feccd60.zip
FreeBSD-src-dc2e474f79c1287592679cd5e0c4c2307feccd60.tar.gz
Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
Diffstat (limited to 'sys/net/if_ppp.c')
-rw-r--r--sys/net/if_ppp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c
index 091b25e..e2c25eb 100644
--- a/sys/net/if_ppp.c
+++ b/sys/net/if_ppp.c
@@ -376,7 +376,7 @@ pppioctl(sc, cmd, data, flag, td)
break;
case PPPIOCSFLAGS:
- if ((error = suser(p)) != 0)
+ if ((error = suser(td)) != 0)
break;
flags = *(int *)data & SC_MASK;
s = splsoftnet();
@@ -390,7 +390,7 @@ pppioctl(sc, cmd, data, flag, td)
break;
case PPPIOCSMRU:
- if ((error = suser(p)) != 0)
+ if ((error = suser(td)) != 0)
return (error);
mru = *(int *)data;
if (mru >= PPP_MRU && mru <= PPP_MAXMRU)
@@ -403,7 +403,7 @@ pppioctl(sc, cmd, data, flag, td)
#ifdef VJC
case PPPIOCSMAXCID:
- if ((error = suser(p)) != 0)
+ if ((error = suser(td)) != 0)
break;
if (sc->sc_comp) {
s = splsoftnet();
@@ -414,14 +414,14 @@ pppioctl(sc, cmd, data, flag, td)
#endif
case PPPIOCXFERUNIT:
- if ((error = suser(p)) != 0)
+ if ((error = suser(td)) != 0)
break;
sc->sc_xfer = p->p_pid;
break;
#ifdef PPP_COMPRESS
case PPPIOCSCOMPRESS:
- if ((error = suser(p)) != 0)
+ if ((error = suser(td)) != 0)
break;
odp = (struct ppp_option_data *) data;
nb = odp->length;
@@ -497,7 +497,7 @@ pppioctl(sc, cmd, data, flag, td)
if (cmd == PPPIOCGNPMODE) {
npi->mode = sc->sc_npmode[npx];
} else {
- if ((error = suser(p)) != 0)
+ if ((error = suser(td)) != 0)
break;
if (npi->mode != sc->sc_npmode[npx]) {
s = splsoftnet();
@@ -573,7 +573,7 @@ pppsioctl(ifp, cmd, data)
u_long cmd;
caddr_t data;
{
- struct proc *p = curproc; /* XXX */
+ struct thread *td = curthread; /* XXX */
register struct ppp_softc *sc = &ppp_softc[ifp->if_unit];
register struct ifaddr *ifa = (struct ifaddr *)data;
register struct ifreq *ifr = (struct ifreq *)data;
@@ -623,7 +623,7 @@ pppsioctl(ifp, cmd, data)
break;
case SIOCSIFMTU:
- if ((error = suser(p)) != 0)
+ if ((error = suser(td)) != 0)
break;
if (ifr->ifr_mtu > PPP_MAXMTU)
error = EINVAL;
OpenPOWER on IntegriCloud