summaryrefslogtreecommitdiff
path: root/sys/kern/kern_sysctl.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2017-05-06 18:18:12 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2017-05-06 18:18:12 +0000
commita2a1592e4813a70f31e289399aaccde362c41a4d (patch)
tree00593a42037668f7dbae396591c8e3ed19aaa93f /sys/kern/kern_sysctl.c
parent9af2dd37ac696132ee30f7f49d5ea46ad696d5f3 (diff)
Do not export the protocol PCB pointer from kernel to non-root users
also in the IPv6 case. This fixes "netstat -An -f inet6 -p tcp" and shows 0x0. report and OK dhill@
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r--sys/kern/kern_sysctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 807a35fe75c..218cc683e8d 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.325 2017/04/27 21:39:27 bluhm Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.326 2017/05/06 18:18:11 bluhm Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -1160,7 +1160,8 @@ fill_file(struct kinfo_file *kf, struct file *fp, struct filedesc *fdp,
case AF_INET6: {
struct inpcb *inpcb = so->so_pcb;
- kf->inp_ppcb = PTRTOINT64(inpcb->inp_ppcb);
+ if (show_pointers)
+ kf->inp_ppcb = PTRTOINT64(inpcb->inp_ppcb);
kf->inp_lport = inpcb->inp_lport;
kf->inp_laddru[0] = inpcb->inp_laddr6.s6_addr32[0];
kf->inp_laddru[1] = inpcb->inp_laddr6.s6_addr32[1];