Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/altq Remove FreeBSD blocks that did not compile anyway, ...
details: https://anonhg.NetBSD.org/src/rev/ca39d80a0b34
branches: trunk
changeset: 986977:ca39d80a0b34
user: christos <christos%NetBSD.org@localhost>
date: Tue Sep 21 14:30:15 2021 +0000
description:
Remove FreeBSD blocks that did not compile anyway, and use l->l_cred
consistently.
diffstat:
sys/altq/altq_afmap.c | 13 +++++--------
sys/altq/altq_blue.c | 9 ++-------
sys/altq/altq_cbq.c | 13 +++++--------
sys/altq/altq_cdnr.c | 8 ++------
sys/altq/altq_conf.c | 16 ++++++----------
sys/altq/altq_fifoq.c | 9 ++-------
sys/altq/altq_hfsc.c | 9 ++-------
sys/altq/altq_jobs.c | 12 +++---------
sys/altq/altq_priq.c | 9 ++-------
sys/altq/altq_red.c | 11 +++--------
sys/altq/altq_rio.c | 9 ++-------
sys/altq/altq_wfq.c | 8 ++------
12 files changed, 36 insertions(+), 90 deletions(-)
diffs (truncated from 424 to 300 lines):
diff -r 0100f9dd639a -r ca39d80a0b34 sys/altq/altq_afmap.c
--- a/sys/altq/altq_afmap.c Tue Sep 21 13:51:46 2021 +0000
+++ b/sys/altq/altq_afmap.c Tue Sep 21 14:30:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_afmap.c,v 1.20 2014/03/20 20:51:54 christos Exp $ */
+/* $NetBSD: altq_afmap.c,v 1.21 2021/09/21 14:30:15 christos Exp $ */
/* $KAME: altq_afmap.c,v 1.12 2005/04/13 03:44:24 suz Exp $ */
/*
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_afmap.c,v 1.20 2014/03/20 20:51:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_afmap.c,v 1.21 2021/09/21 14:30:15 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -357,12 +357,9 @@
case AFM_GETFMAP:
break;
default:
-#if (__FreeBSD_version > 400000)
- error = suser(p);
-#else
- error = kauth_authorize_network(l->l_cred, KAUTH_NETWORK_ALTQ,
- KAUTH_REQ_NETWORK_ALTQ_AFMAP, NULL, NULL, NULL);
-#endif
+ error = kauth_authorize_network(l->l_cred,
+ KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_AFMAP, NULL,
+ NULL, NULL);
if (error)
return (error);
break;
diff -r 0100f9dd639a -r ca39d80a0b34 sys/altq/altq_blue.c
--- a/sys/altq/altq_blue.c Tue Sep 21 13:51:46 2021 +0000
+++ b/sys/altq/altq_blue.c Tue Sep 21 14:30:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_blue.c,v 1.25 2019/12/26 04:53:11 msaitoh Exp $ */
+/* $NetBSD: altq_blue.c,v 1.26 2021/09/21 14:30:15 christos Exp $ */
/* $KAME: altq_blue.c,v 1.15 2005/04/13 03:44:24 suz Exp $ */
/*
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_blue.c,v 1.25 2019/12/26 04:53:11 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_blue.c,v 1.26 2021/09/21 14:30:15 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -163,15 +163,10 @@
case BLUE_GETSTATS:
break;
default:
-#if (__FreeBSD_version > 400000)
- if ((error = suser(p)) != 0)
- return (error);
-#else
if ((error = kauth_authorize_network(l->l_cred,
KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_BLUE, NULL,
NULL, NULL)) != 0)
return (error);
-#endif
break;
}
diff -r 0100f9dd639a -r ca39d80a0b34 sys/altq/altq_cbq.c
--- a/sys/altq/altq_cbq.c Tue Sep 21 13:51:46 2021 +0000
+++ b/sys/altq/altq_cbq.c Tue Sep 21 14:30:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_cbq.c,v 1.37 2021/08/17 22:00:26 andvar Exp $ */
+/* $NetBSD: altq_cbq.c,v 1.38 2021/09/21 14:30:15 christos Exp $ */
/* $KAME: altq_cbq.c,v 1.21 2005/04/13 03:44:24 suz Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.37 2021/08/17 22:00:26 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.38 2021/09/21 14:30:15 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -1011,12 +1011,9 @@
/* currently only command that an ordinary user can call */
break;
default:
-#if (__FreeBSD_version > 400000)
- error = suser(p);
-#else
- error = kauth_authorize_network(l->l_cred, KAUTH_NETWORK_ALTQ,
- KAUTH_REQ_NETWORK_ALTQ_CBQ, NULL, NULL, NULL);
-#endif
+ error = kauth_authorize_network(l->l_cred,
+ KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_CBQ, NULL, NULL,
+ NULL);
if (error)
return (error);
break;
diff -r 0100f9dd639a -r ca39d80a0b34 sys/altq/altq_cdnr.c
--- a/sys/altq/altq_cdnr.c Tue Sep 21 13:51:46 2021 +0000
+++ b/sys/altq/altq_cdnr.c Tue Sep 21 14:30:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_cdnr.c,v 1.21 2016/06/10 13:31:43 ozaki-r Exp $ */
+/* $NetBSD: altq_cdnr.c,v 1.22 2021/09/21 14:30:15 christos Exp $ */
/* $KAME: altq_cdnr.c,v 1.15 2005/04/13 03:44:24 suz Exp $ */
/*
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_cdnr.c,v 1.21 2016/06/10 13:31:43 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_cdnr.c,v 1.22 2021/09/21 14:30:15 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -1189,13 +1189,9 @@
case CDNR_GETSTATS:
break;
default:
-#if (__FreeBSD_version > 400000)
- if ((error = suser(p)) != 0)
-#else
if ((error = kauth_authorize_network(l->l_cred,
KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_CDNR, NULL,
NULL, NULL)) != 0)
-#endif
return (error);
break;
}
diff -r 0100f9dd639a -r ca39d80a0b34 sys/altq/altq_conf.c
--- a/sys/altq/altq_conf.c Tue Sep 21 13:51:46 2021 +0000
+++ b/sys/altq/altq_conf.c Tue Sep 21 14:30:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_conf.c,v 1.21 2014/07/25 08:10:31 dholland Exp $ */
+/* $NetBSD: altq_conf.c,v 1.22 2021/09/21 14:30:15 christos Exp $ */
/* $KAME: altq_conf.c,v 1.24 2005/04/13 03:44:24 suz Exp $ */
/*
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_conf.c,v 1.21 2014/07/25 08:10:31 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_conf.c,v 1.22 2021/09/21 14:30:15 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -224,15 +224,11 @@
case ALTQTBRGET:
break;
default:
-#if (__FreeBSD_version > 400000)
- if ((error = suser(p)) != 0)
+ if ((error = kauth_authorize_network(
+ l->l_cred, KAUTH_NETWORK_ALTQ,
+ KAUTH_REQ_NETWORK_ALTQ_CONF, NULL, NULL,
+ NULL)) != 0)
return (error);
-#else
- if ((error = kauth_authorize_network(l->l_cred,
- KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_CONF,
- NULL, NULL, NULL)) != 0)
- return (error);
-#endif
break;
}
diff -r 0100f9dd639a -r ca39d80a0b34 sys/altq/altq_fifoq.c
--- a/sys/altq/altq_fifoq.c Tue Sep 21 13:51:46 2021 +0000
+++ b/sys/altq/altq_fifoq.c Tue Sep 21 14:30:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_fifoq.c,v 1.17 2016/04/20 08:58:48 knakahara Exp $ */
+/* $NetBSD: altq_fifoq.c,v 1.18 2021/09/21 14:30:15 christos Exp $ */
/* $KAME: altq_fifoq.c,v 1.12 2003/07/10 12:07:48 kjc Exp $ */
/*
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.17 2016/04/20 08:58:48 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.18 2021/09/21 14:30:15 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -131,15 +131,10 @@
case FIFOQ_GETSTATS:
break;
default:
-#if (__FreeBSD_version > 400000)
- if ((error = suser(p)) != 0)
- return (error);
-#else
if ((error = kauth_authorize_network(l->l_cred,
KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_FIFOQ, NULL,
NULL, NULL)) != 0)
return (error);
-#endif
break;
}
diff -r 0100f9dd639a -r ca39d80a0b34 sys/altq/altq_hfsc.c
--- a/sys/altq/altq_hfsc.c Tue Sep 21 13:51:46 2021 +0000
+++ b/sys/altq/altq_hfsc.c Tue Sep 21 14:30:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_hfsc.c,v 1.29 2021/08/30 08:40:31 riastradh Exp $ */
+/* $NetBSD: altq_hfsc.c,v 1.30 2021/09/21 14:30:15 christos Exp $ */
/* $KAME: altq_hfsc.c,v 1.26 2005/04/13 03:44:24 suz Exp $ */
/*
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_hfsc.c,v 1.29 2021/08/30 08:40:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_hfsc.c,v 1.30 2021/09/21 14:30:15 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -1916,15 +1916,10 @@
case HFSC_GETSTATS:
break;
default:
-#if (__FreeBSD_version > 400000)
- if ((error = suser(p)) != 0)
- return (error);
-#else
if ((error = kauth_authorize_network(l->l_cred,
KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_HFSC, NULL,
NULL, NULL)) != 0)
return (error);
-#endif
break;
}
diff -r 0100f9dd639a -r ca39d80a0b34 sys/altq/altq_jobs.c
--- a/sys/altq/altq_jobs.c Tue Sep 21 13:51:46 2021 +0000
+++ b/sys/altq/altq_jobs.c Tue Sep 21 14:30:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_jobs.c,v 1.11 2017/07/28 13:53:17 riastradh Exp $ */
+/* $NetBSD: altq_jobs.c,v 1.12 2021/09/21 14:30:15 christos Exp $ */
/* $KAME: altq_jobs.c,v 1.11 2005/04/13 03:44:25 suz Exp $ */
/*
* Copyright (c) 2001, the Rector and Board of Visitors of the
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_jobs.c,v 1.11 2017/07/28 13:53:17 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_jobs.c,v 1.12 2021/09/21 14:30:15 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -1858,7 +1858,6 @@
{
struct jobs_if *jif;
struct jobs_interface *ifacep;
- struct proc *p = l->l_proc;
int error = 0;
/* check super-user privilege */
@@ -1866,15 +1865,10 @@
case JOBS_GETSTATS:
break;
default:
-#if (__FreeBSD_version > 400000)
- if ((error = suser(p)) != 0)
- return (error);
-#else
- if ((error = kauth_authorize_network(p->p_cred,
+ if ((error = kauth_authorize_network(l->l_cred,
KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_JOBS, NULL,
NULL, NULL)) != 0)
return (error);
-#endif
break;
}
diff -r 0100f9dd639a -r ca39d80a0b34 sys/altq/altq_priq.c
--- a/sys/altq/altq_priq.c Tue Sep 21 13:51:46 2021 +0000
+++ b/sys/altq/altq_priq.c Tue Sep 21 14:30:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_priq.c,v 1.27 2021/08/30 08:40:31 riastradh Exp $ */
+/* $NetBSD: altq_priq.c,v 1.28 2021/09/21 14:30:15 christos Exp $ */
/* $KAME: altq_priq.c,v 1.13 2005/04/13 03:44:25 suz Exp $ */
/*
* Copyright (C) 2000-2003
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_priq.c,v 1.27 2021/08/30 08:40:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_priq.c,v 1.28 2021/09/21 14:30:15 christos Exp $");
#ifdef _KERNEL_OPT
Home |
Main Index |
Thread Index |
Old Index