Module Name: src
Committed By: christos
Date: Tue Sep 21 15:05:41 UTC 2021
Modified Files:
src/sys/netinet: in.c
Log Message:
don't opencode kauth_cred_get()
To generate a diff of this commit:
cvs rdiff -u -r1.241 -r1.242 src/sys/netinet/in.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/netinet/in.c
diff -u src/sys/netinet/in.c:1.241 src/sys/netinet/in.c:1.242
--- src/sys/netinet/in.c:1.241 Tue Sep 29 15:33:36 2020
+++ src/sys/netinet/in.c Tue Sep 21 11:05:41 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: in.c,v 1.241 2020/09/29 19:33:36 roy Exp $ */
+/* $NetBSD: in.c,v 1.242 2021/09/21 15:05:41 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.241 2020/09/29 19:33:36 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.242 2021/09/21 15:05:41 christos Exp $");
#include "arp.h"
@@ -521,7 +521,8 @@ in_control0(struct socket *so, u_long cm
goto out;
}
- if (kauth_authorize_network(curlwp->l_cred, KAUTH_NETWORK_INTERFACE,
+ if (kauth_authorize_network(kauth_cred_get(),
+ KAUTH_NETWORK_INTERFACE,
KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, (void *)cmd,
NULL) != 0) {
error = EPERM;
@@ -565,7 +566,8 @@ in_control0(struct socket *so, u_long cm
break;
case SIOCSIFBRDADDR:
- if (kauth_authorize_network(curlwp->l_cred, KAUTH_NETWORK_INTERFACE,
+ if (kauth_authorize_network(kauth_cred_get(),
+ KAUTH_NETWORK_INTERFACE,
KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, (void *)cmd,
NULL) != 0) {
error = EPERM;