Don't kauth-orize SIOCSIFMTU in pppsioctl() and stf_ioctl(), ifioctl()
has already done that for us.
This commit is contained in:
parent
7609a81937
commit
60d9d0608c
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_ppp.c,v 1.134 2011/08/07 13:51:37 rmind Exp $ */
|
||||
/* $NetBSD: if_ppp.c,v 1.135 2011/10/28 20:13:32 dyoung Exp $ */
|
||||
/* Id: if_ppp.c,v 1.6 1997/03/04 03:33:00 paulus Exp */
|
||||
|
||||
/*
|
||||
@ -102,7 +102,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.134 2011/08/07 13:51:37 rmind Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.135 2011/10/28 20:13:32 dyoung Exp $");
|
||||
|
||||
#include "ppp.h"
|
||||
|
||||
@ -734,7 +734,6 @@ pppioctl(struct ppp_softc *sc, u_long cmd, void *data, int flag,
|
||||
static int
|
||||
pppsioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||
{
|
||||
struct lwp *l = curlwp; /* XXX */
|
||||
struct ppp_softc *sc = ifp->if_softc;
|
||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||
struct ifreq *ifr = (struct ifreq *)data;
|
||||
@ -834,12 +833,6 @@ pppsioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||
break;
|
||||
#endif /* PPP_COMPRESS */
|
||||
|
||||
case SIOCSIFMTU:
|
||||
if ((error = kauth_authorize_network(l->l_cred,
|
||||
KAUTH_NETWORK_INTERFACE, KAUTH_REQ_NETWORK_INTERFACE_SETPRIV,
|
||||
ifp, (void *)cmd, NULL)) != 0)
|
||||
break;
|
||||
/*FALLTHROUGH*/
|
||||
default:
|
||||
if ((error = ifioctl_common(&sc->sc_if, cmd, data)) == ENETRESET)
|
||||
error = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_stf.c,v 1.76 2011/07/17 20:54:52 joerg Exp $ */
|
||||
/* $NetBSD: if_stf.c,v 1.77 2011/10/28 20:13:32 dyoung Exp $ */
|
||||
/* $KAME: if_stf.c,v 1.62 2001/06/07 22:32:16 itojun Exp $ */
|
||||
|
||||
/*
|
||||
@ -75,7 +75,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.76 2011/07/17 20:54:52 joerg Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.77 2011/10/28 20:13:32 dyoung Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
@ -90,7 +90,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.76 2011/07/17 20:54:52 joerg Exp $");
|
||||
#include <sys/protosw.h>
|
||||
#include <sys/queue.h>
|
||||
#include <sys/syslog.h>
|
||||
#include <sys/kauth.h>
|
||||
|
||||
#include <sys/cpu.h>
|
||||
|
||||
@ -661,7 +660,6 @@ stf_rtrequest(int cmd, struct rtentry *rt,
|
||||
static int
|
||||
stf_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||
{
|
||||
struct lwp *l = curlwp; /* XXX */
|
||||
struct ifaddr *ifa;
|
||||
struct ifreq *ifr = data;
|
||||
struct sockaddr_in6 *sin6;
|
||||
@ -694,12 +692,6 @@ stf_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||
break;
|
||||
|
||||
case SIOCSIFMTU:
|
||||
error = kauth_authorize_network(l->l_cred,
|
||||
KAUTH_NETWORK_INTERFACE,
|
||||
KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, KAUTH_ARG(cmd),
|
||||
NULL);
|
||||
if (error)
|
||||
break;
|
||||
if (ifr->ifr_mtu < STF_MTU_MIN || ifr->ifr_mtu > STF_MTU_MAX)
|
||||
return EINVAL;
|
||||
else if ((error = ifioctl_common(ifp, cmd, data)) == ENETRESET)
|
||||
|
Loading…
Reference in New Issue
Block a user