summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2019-05-09 14:59:31 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2019-05-09 14:59:31 +0000
commitf605ac9a3bcddfa80c6d059e11f87506427002b8 (patch)
treee381ed8687e7fc264b6f83f71759d198a48f3be8 /sys/kern
parenta329a38a6e0b3c0b36f83afa9176490cb00e299c (diff)
Add a sysctl accessor to struct pf_status. The pf_status only holds the
current status and statistics and can be exported without super-user rights via sysctl to make it easier for tools like systat to access those. OK deraadt@, sashan@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sysctl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 93bbb5019b3..465bb6038ef 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.354 2019/01/29 14:07:15 visa Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.355 2019/05/09 14:59:30 claudio Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -114,6 +114,7 @@
#endif
#include "audio.h"
+#include "pf.h"
extern struct forkstat forkstat;
extern struct nchstats nchstats;
@@ -668,6 +669,10 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
case KERN_CPUSTATS:
return (sysctl_cpustats(name + 1, namelen - 1, oldp, oldlenp,
newp, newlen));
+#if NPF > 0
+ case KERN_PFSTATUS:
+ return (pf_sysctl(oldp, oldlenp, newp, newlen));
+#endif
default:
return (EOPNOTSUPP);
}