From owner-svn-src-all@FreeBSD.ORG Thu May 8 19:35:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55E5C84B; Thu, 8 May 2014 19:35:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35E86AB3; Thu, 8 May 2014 19:35:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48JZV5o029802; Thu, 8 May 2014 19:35:31 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48JZUn6029773; Thu, 8 May 2014 19:35:30 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405081935.s48JZUn6029773@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Thu, 8 May 2014 19:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r265702 - in stable/9: sbin/route usr.bin/netstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 19:35:31 -0000 Author: melifaro Date: Thu May 8 19:35:29 2014 New Revision: 265702 URL: http://svnweb.freebsd.org/changeset/base/265702 Log: Merge r260524,r260540 r260524: Add -4/-6 shorthand for -finet/-finet6 in route(8) and netstat(8). r260540: Bump dates in nestat(1) and route(8) man pages. Fix several small errors introduced by r260524. Suggested by: glebius Modified: stable/9/sbin/route/keywords stable/9/sbin/route/route.8 stable/9/sbin/route/route.c stable/9/usr.bin/netstat/main.c stable/9/usr.bin/netstat/netstat.1 Directory Properties: stable/9/sbin/ (props changed) stable/9/sbin/route/ (props changed) stable/9/usr.bin/ (props changed) stable/9/usr.bin/netstat/ (props changed) Modified: stable/9/sbin/route/keywords ============================================================================== --- stable/9/sbin/route/keywords Thu May 8 19:35:12 2014 (r265701) +++ stable/9/sbin/route/keywords Thu May 8 19:35:29 2014 (r265702) @@ -1,6 +1,8 @@ # @(#)keywords 8.2 (Berkeley) 3/19/94 # $FreeBSD$ +4 +6 add atalk blackhole Modified: stable/9/sbin/route/route.8 ============================================================================== --- stable/9/sbin/route/route.8 Thu May 8 19:35:12 2014 (r265701) +++ stable/9/sbin/route/route.8 Thu May 8 19:35:29 2014 (r265702) @@ -62,6 +62,14 @@ programmatic interface discussed in .Pp The following options are available: .Bl -tag -width indent +.It Fl 4 +Specify +.Cm inet +address family as family hint for subcommands. +.It Fl 6 +Specify +.Cm inet +address family as family hint for subcommands. .It Fl d Run in debug-only mode, i.e., do not actually modify the routing table. .It Fl n @@ -134,10 +142,20 @@ When the address family may is specified .Fl xns , .Fl atalk , .Fl inet6 , +.Fl 6, +.Fl inet, or -.Fl inet +.Fl 4 modifiers, only routes having destinations with addresses in the -delineated family will be deleted. +delineated family will be deleted. Additionally, +.Fl 4 +or +.Fl 6 +can be used as aliases for +.Fl inet +and +.Fl inet6 +modifiers. When a .Fl fib option is specified, the operation will be applied to Modified: stable/9/sbin/route/route.c ============================================================================== --- stable/9/sbin/route/route.c Thu May 8 19:35:12 2014 (r265701) +++ stable/9/sbin/route/route.c Thu May 8 19:35:29 2014 (r265702) @@ -153,7 +153,7 @@ usage(const char *cp) if (cp != NULL) warnx("bad keyword: %s", cp); (void) fprintf(stderr, - "usage: route [-dnqtv] command [[modifiers] args]\n"); + "usage: route [-46dnqtv] command [[modifiers] args]\n"); exit(EX_USAGE); /* NOTREACHED */ } @@ -167,8 +167,24 @@ main(int argc, char **argv) if (argc < 2) usage(NULL); - while ((ch = getopt(argc, argv, "nqdtv")) != -1) + while ((ch = getopt(argc, argv, "46nqdtv")) != -1) switch(ch) { + case '4': +#ifdef INET + af = AF_INET; + aflen = sizeof(struct sockaddr_in); +#else + errx(1, "IPv4 support is not compiled in"); +#endif + break; + case '6': +#ifdef INET6 + af = AF_INET6; + aflen = sizeof(struct sockaddr_in6); +#else + errx(1, "IPv6 support is not compiled in"); +#endif + break; case 'n': nflag = 1; break; @@ -389,10 +405,12 @@ flushroutes(int argc, char *argv[]) if (**argv != '-') usage(*argv); switch (keyword(*argv + 1)) { + case K_4: case K_INET: af = AF_INET; break; #ifdef INET6 + case K_6: case K_INET6: af = AF_INET6; break; @@ -807,11 +825,13 @@ newroute(int argc, char **argv) af = AF_LINK; aflen = sizeof(struct sockaddr_dl); break; + case K_4: case K_INET: af = AF_INET; aflen = sizeof(struct sockaddr_in); break; #ifdef INET6 + case K_6: case K_INET6: af = AF_INET6; aflen = sizeof(struct sockaddr_in6); Modified: stable/9/usr.bin/netstat/main.c ============================================================================== --- stable/9/usr.bin/netstat/main.c Thu May 8 19:35:12 2014 (r265701) +++ stable/9/usr.bin/netstat/main.c Thu May 8 19:35:29 2014 (r265702) @@ -366,9 +366,23 @@ main(int argc, char *argv[]) af = AF_UNSPEC; - while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:Qq:rSTsuWw:xz")) + while ((ch = getopt(argc, argv, "46AaBbdf:ghI:iLlM:mN:np:Qq:rSTsuWw:xz")) != -1) switch(ch) { + case '4': +#ifdef INET + af = AF_INET; +#else + errx(1, "IPv4 support is not compiled in"); +#endif + break; + case '6': +#ifdef INET6 + af = AF_INET6; +#else + errx(1, "IPv6 support is not compiled in"); +#endif + break; case 'A': Aflag = 1; break; @@ -805,21 +819,21 @@ static void usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", -"usage: netstat [-AaLnSTWx] [-f protocol_family | -p protocol]\n" +"usage: netstat [-46AaLnSTWx] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", -" netstat -i | -I interface [-abdhnW] [-f address_family]\n" +" netstat -i | -I interface [-46abdhnW] [-f address_family]\n" " [-M core] [-N system]", -" netstat -w wait [-I interface] [-d] [-M core] [-N system] [-q howmany]", -" netstat -s [-s] [-z] [-f protocol_family | -p protocol]\n" +" netstat -w wait [-I interface] [-46d] [-M core] [-N system] [-q howmany]", +" netstat -s [-s] [-46z] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", -" netstat -i | -I interface -s [-f protocol_family | -p protocol]\n" +" netstat -i | -I interface [-46s] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", " netstat -m [-M core] [-N system]", " netstat -B [-I interface]", -" netstat -r [-AanW] [-f address_family] [-M core] [-N system]", +" netstat -r [-46AanW] [-f address_family] [-M core] [-N system]", " netstat -rs [-s] [-M core] [-N system]", -" netstat -g [-W] [-f address_family] [-M core] [-N system]", -" netstat -gs [-s] [-f address_family] [-M core] [-N system]", +" netstat -g [-46W] [-f address_family] [-M core] [-N system]", +" netstat -gs [-46s] [-f address_family] [-M core] [-N system]", " netstat -Q"); exit(1); } Modified: stable/9/usr.bin/netstat/netstat.1 ============================================================================== --- stable/9/usr.bin/netstat/netstat.1 Thu May 8 19:35:12 2014 (r265701) +++ stable/9/usr.bin/netstat/netstat.1 Thu May 8 19:35:29 2014 (r265702) @@ -28,7 +28,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 10, 2013 +.Dd May 8, 2014 .Dt NETSTAT 1 .Os .Sh NAME @@ -45,7 +45,7 @@ depending on the options for the informa .It Xo .Bk -words .Nm -.Op Fl AaLnSTWx +.Op Fl 46AaLnSTWx .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -92,7 +92,7 @@ retransmits, out-of-order packets receiv .Bk -words .Nm .Fl i | I Ar interface -.Op Fl abdhnW +.Op Fl 46abdhnW .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system @@ -155,7 +155,7 @@ is also present, show the number of drop .Bk -words .Nm .Fl s Op Fl s -.Op Fl z +.Op Fl 46z .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -176,6 +176,7 @@ is also present, reset statistic counter .Bk -words .Nm .Fl i | I Ar interface Fl s +.Op Fl 46 .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -216,7 +217,7 @@ states. .Bk -words .Nm .Fl r -.Op Fl AanW +.Op Fl 46AanW .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system @@ -263,7 +264,7 @@ is repeated, counters with a value of ze .Bk -words .Nm .Fl g -.Op Fl W +.Op Fl 46W .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system @@ -282,7 +283,7 @@ address families. .Bk -words .Nm .Fl gs -.Op Fl s +.Op Fl 46s .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system @@ -311,6 +312,14 @@ The flags field shows available ISR hand .Pp Some options have the general meaning: .Bl -tag -width flag +.It Fl 4 +Is shorthand for +.Fl f +.Ar inet +.It Fl 6 +Is shorthand for +.Fl f +.Ar inet6 .It Fl f Ar address_family , Fl p Ar protocol Limit display to those records of the specified