Module Name: src
Committed By: christos
Date: Tue Sep 21 14:56:42 UTC 2021
Modified Files:
src/sys/net: if.c
Log Message:
don't opencode kauth_cred_get()
To generate a diff of this commit:
cvs rdiff -u -r1.488 -r1.489 src/sys/net/if.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.c
diff -u src/sys/net/if.c:1.488 src/sys/net/if.c:1.489
--- src/sys/net/if.c:1.488 Thu Sep 16 16:17:47 2021
+++ src/sys/net/if.c Tue Sep 21 10:56:42 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: if.c,v 1.488 2021/09/16 20:17:47 andvar Exp $ */
+/* $NetBSD: if.c,v 1.489 2021/09/21 14:56:42 christos Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.488 2021/09/16 20:17:47 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.489 2021/09/21 14:56:42 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -3163,7 +3163,7 @@ ifioctl_common(struct ifnet *ifp, u_long
ifp->if_mtu = ifr->ifr_mtu;
return ENETRESET;
case SIOCSIFDESCR:
- error = kauth_authorize_network(curlwp->l_cred,
+ error = kauth_authorize_network(kauth_cred_get(),
KAUTH_NETWORK_INTERFACE,
KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, KAUTH_ARG(cmd),
NULL);
@@ -3232,7 +3232,7 @@ ifaddrpref_ioctl(struct socket *so, u_lo
switch (cmd) {
case SIOCSIFADDRPREF:
- error = kauth_authorize_network(curlwp->l_cred,
+ error = kauth_authorize_network(kauth_cred_get(),
KAUTH_NETWORK_INTERFACE,
KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, KAUTH_ARG(cmd),
NULL);
@@ -3346,7 +3346,7 @@ doifioctl(struct socket *so, u_long cmd,
bound = curlwp_bind();
if (l != NULL) {
ifp = if_get(ifr->ifr_name, &psref);
- error = kauth_authorize_network(l->l_cred,
+ error = kauth_authorize_network(l->l_proc, l->l_cred,
KAUTH_NETWORK_INTERFACE,
KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp,
KAUTH_ARG(cmd), NULL);
@@ -3411,7 +3411,7 @@ doifioctl(struct socket *so, u_long cmd,
case SIOCS80211CHANNEL:
case SIOCSLINKSTR:
if (l != NULL) {
- error = kauth_authorize_network(l->l_cred,
+ error = kauth_authorize_network(l->l_proc, l->l_cred,
KAUTH_NETWORK_INTERFACE,
KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp,
KAUTH_ARG(cmd), NULL);