summaryrefslogtreecommitdiff
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2011-11-01 17:30:05 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2011-11-01 17:30:05 +0000
commit764ad8198833d7d48ba411fb81b6e0c96cb0df13 (patch)
tree2a6806ee0b8a25471b8f4d01139676340cb85740 /usr.bin/netstat
parentd62356fda85467e899b8d7e8c6c88308b7a3795a (diff)
Do some cleanup and improve the manpage. From Andreas Bartelt; ok henning, jmc
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/main.c4
-rw-r--r--usr.bin/netstat/netstat.18
-rw-r--r--usr.bin/netstat/netstat.h4
-rw-r--r--usr.bin/netstat/show.c11
4 files changed, 12 insertions, 15 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 468335df05d..95e000df9c9 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.91 2011/11/01 10:14:06 mikeb Exp $ */
+/* $OpenBSD: main.c,v 1.92 2011/11/01 17:30:04 mikeb Exp $ */
/* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */
/*
@@ -380,7 +380,7 @@ main(int argc, char *argv[])
nl[N_AF2RTAFIDX].n_value, nl[N_RTBLIDMAX].n_value,
tableid);
else
- p_rttables(af, tableid, Tflag);
+ p_rttables(af, tableid);
exit(0);
}
if (gflag) {
diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1
index c2a3929b7f7..d6d227ae9e5 100644
--- a/usr.bin/netstat/netstat.1
+++ b/usr.bin/netstat/netstat.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: netstat.1,v 1.66 2011/09/03 22:59:07 jmc Exp $
+.\" $OpenBSD: netstat.1,v 1.67 2011/11/01 17:30:04 mikeb Exp $
.\" $NetBSD: netstat.1,v 1.11 1995/10/03 21:42:43 thorpej Exp $
.\"
.\" Copyright (c) 1983, 1990, 1992, 1993
@@ -30,7 +30,7 @@
.\"
.\" from: @(#)netstat.1 8.8 (Berkeley) 4/18/94
.\"
-.Dd $Mdocdate: September 3 2011 $
+.Dd $Mdocdate: November 1 2011 $
.Dt NETSTAT 1
.Os
.Sh NAME
@@ -272,8 +272,8 @@ option, also print routing labels.
Show per-protocol statistics.
If this option is repeated, counters with a value of zero are suppressed.
.It Fl T Ar tableid
-Select an alternate routing table to modify or query.
-Table 0 is the default table.
+Select an alternate routing table to query.
+The default is to use the current routing table.
.It Fl t
With the
.Fl i
diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h
index 7583c1f9ca0..459222d9705 100644
--- a/usr.bin/netstat/netstat.h
+++ b/usr.bin/netstat/netstat.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: netstat.h,v 1.61 2011/11/01 00:00:01 mikeb Exp $ */
+/* $OpenBSD: netstat.h,v 1.62 2011/11/01 17:30:04 mikeb Exp $ */
/* $NetBSD: netstat.h,v 1.6 1996/05/07 02:55:05 thorpej Exp $ */
/*
@@ -116,7 +116,7 @@ void mrt6_stats(void);
char *routename6(struct sockaddr_in6 *);
char *netname6(struct sockaddr_in6 *, struct sockaddr_in6 *);
-void p_rttables(int, u_int, int);
+void p_rttables(int, u_int);
void p_flags(int, char *);
void p_addr(struct sockaddr *, struct sockaddr *, int);
void p_gwaddr(struct sockaddr *, int);
diff --git a/usr.bin/netstat/show.c b/usr.bin/netstat/show.c
index 6d27a598e8e..5e35b541519 100644
--- a/usr.bin/netstat/show.c
+++ b/usr.bin/netstat/show.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: show.c,v 1.34 2010/10/11 12:33:36 claudio Exp $ */
+/* $OpenBSD: show.c,v 1.35 2011/11/01 17:30:04 mikeb Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
@@ -116,7 +116,7 @@ void index_pfk(struct sadb_msg *, void **);
* Print routing tables.
*/
void
-p_rttables(int af, u_int tableid, int hastable)
+p_rttables(int af, u_int tableid)
{
struct rt_msghdr *rtm;
struct sadb_msg *msg;
@@ -131,11 +131,8 @@ p_rttables(int af, u_int tableid, int hastable)
mib[3] = af;
mib[4] = NET_RT_DUMP;
mib[5] = 0;
- if (hastable) {
- mib[6] = tableid;
- mcnt = 7;
- } else
- mcnt = 6;
+ mib[6] = tableid;
+ mcnt = 7;
if (sysctl(mib, mcnt, NULL, &needed, NULL, 0) < 0)
err(1, "route-sysctl-estimate");