summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/main.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2006-08-29 21:51:13 +0000
committerclaudio <claudio@openbsd.org>2006-08-29 21:51:13 +0000
commit0dad96934e5acb87924cfae22fe01d7af4191ba7 (patch)
treefeae6ba7da510fa442282af69f811666176f3ec0 /usr.bin/netstat/main.c
parentfix output location of truncated files test (diff)
downloadwireguard-openbsd-0dad96934e5acb87924cfae22fe01d7af4191ba7.tar.xz
wireguard-openbsd-0dad96934e5acb87924cfae22fe01d7af4191ba7.zip
Fix KVM snooping code of netstat that got broken by the multiple table
"support". This makes netstat -A work again. OK markus@ henning@
Diffstat (limited to 'usr.bin/netstat/main.c')
-rw-r--r--usr.bin/netstat/main.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index d743d41c3b6..aa0b3c92ccc 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.62 2006/05/27 19:16:37 claudio Exp $ */
+/* $OpenBSD: main.c,v 1.63 2006/08/29 21:51:13 claudio Exp $ */
/* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */
/*
@@ -40,7 +40,7 @@ char copyright[] =
#if 0
static char sccsid[] = "from: @(#)main.c 8.4 (Berkeley) 3/1/94";
#else
-static char *rcsid = "$OpenBSD: main.c,v 1.62 2006/05/27 19:16:37 claudio Exp $";
+static char *rcsid = "$OpenBSD: main.c,v 1.63 2006/08/29 21:51:13 claudio Exp $";
#endif
#endif /* not lint */
@@ -152,6 +152,12 @@ struct nlist nl[] = {
{ "_pfsyncstats" },
#define N_PIMSTAT 42
{ "_pimstat" },
+#define N_AF2RTAFIDX 43
+ { "_af2rtafidx" },
+#define N_RTBLIDMAX 44
+ { "_rtbl_id_max" },
+#define N_RTMASK 45
+ { "_mask_rnhead" },
{ ""}
};
@@ -290,6 +296,8 @@ main(int argc, char *argv[])
af = PF_KEY;
else if (strcmp(optarg, "atalk") == 0)
af = AF_APPLETALK;
+ else if (strcmp(optarg, "mask") == 0)
+ af = 0xff;
else {
(void)fprintf(stderr,
"%s: %s: unknown address family\n",
@@ -477,7 +485,8 @@ main(int argc, char *argv[])
if (sflag)
rt_stats(0, nl[N_RTSTAT].n_value);
else
- routepr(nl[N_RTREE].n_value);
+ routepr(nl[N_RTREE].n_value, nl[N_RTMASK].n_value,
+ nl[N_AF2RTAFIDX].n_value, nl[N_RTBLIDMAX].n_value);
exit(0);
}
if (gflag) {