summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/main.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2015-02-09 12:25:03 +0000
committerclaudio <claudio@openbsd.org>2015-02-09 12:25:03 +0000
commit60afce571ce92908eff2eec1c3f668a711bd9701 (patch)
treedca7dc3fe9fa609343e6f5902130b61f0e4dae12 /usr.bin/netstat/main.c
parentImplement 2 sysctl to retrieve the multicast forwarding cache (mf6c) and the (diff)
downloadwireguard-openbsd-60afce571ce92908eff2eec1c3f668a711bd9701.tar.xz
wireguard-openbsd-60afce571ce92908eff2eec1c3f668a711bd9701.zip
Get rid of another KVM reader and convert the multicast output to use
the new sysctls. Looks good deraadt@
Diffstat (limited to 'usr.bin/netstat/main.c')
-rw-r--r--usr.bin/netstat/main.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 5465352a87f..41661ead9f6 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.104 2015/02/06 03:22:00 reyk Exp $ */
+/* $OpenBSD: main.c,v 1.105 2015/02/09 12:25:03 claudio Exp $ */
/* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */
/*
@@ -59,18 +59,6 @@ struct nlist nl[] = {
#define N_UDBTABLE 1
{ "_udbtable" },
-#define N_MFCHASHTBL 2
- { "_mfchashtbl" },
-#define N_MFCHASH 3
- { "_mfchash" },
-#define N_VIFTABLE 4
- { "_viftable" },
-
-#define N_MF6CTABLE 5
- { "_mf6ctable" },
-#define N_MIF6TABLE 6
- { "_mif6table" },
-
#define N_RTREE 7
{ "_rt_tables"},
#define N_RTMASK 8
@@ -331,8 +319,8 @@ main(int argc, char *argv[])
#endif
need_nlist = !mflag && (pflag || nlistf != NULL || memf != NULL ||
- (!iflag && !sflag && (rflag ? Aflag :
- (gflag || af != AF_UNIX || Pflag))));
+ (!iflag && !sflag && !gflag && (rflag ? Aflag :
+ (af != AF_UNIX || Pflag))));
/*
* Discard setgid privileges if not the running kernel so that bad
@@ -393,12 +381,9 @@ main(int argc, char *argv[])
mrt6_stats();
} else {
if (af == AF_INET || af == AF_UNSPEC)
- mroutepr(nl[N_MFCHASHTBL].n_value,
- nl[N_MFCHASH].n_value,
- nl[N_VIFTABLE].n_value);
+ mroutepr();
if (af == AF_INET6 || af == AF_UNSPEC)
- mroute6pr(nl[N_MF6CTABLE].n_value,
- nl[N_MIF6TABLE].n_value);
+ mroute6pr();
}
exit(0);
}