Module Name: src Committed By: dyoung Date: Fri Oct 28 20:13:32 UTC 2011
Modified Files: src/sys/net: if_ppp.c if_stf.c Log Message: Don't kauth-orize SIOCSIFMTU in pppsioctl() and stf_ioctl(), ifioctl() has already done that for us. To generate a diff of this commit: cvs rdiff -u -r1.134 -r1.135 src/sys/net/if_ppp.c cvs rdiff -u -r1.76 -r1.77 src/sys/net/if_stf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/if_ppp.c diff -u src/sys/net/if_ppp.c:1.134 src/sys/net/if_ppp.c:1.135 --- src/sys/net/if_ppp.c:1.134 Sun Aug 7 13:51:37 2011 +++ src/sys/net/if_ppp.c Fri Oct 28 20:13:32 2011 @@ -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 cm 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, 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; Index: src/sys/net/if_stf.c diff -u src/sys/net/if_stf.c:1.76 src/sys/net/if_stf.c:1.77 --- src/sys/net/if_stf.c:1.76 Sun Jul 17 20:54:52 2011 +++ src/sys/net/if_stf.c Fri Oct 28 20:13:32 2011 @@ -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 #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 *r 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, 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)