From 88f94d4290a2b8f5876b97f2d3f446f1637286a8 Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Mon, 24 Mar 2014 11:11:50 +0000 Subject: Remove "-r" option from ping(8) and traceroute{,6}(8). You've probably never heard about it, it was to bypass the routing tables, not available for IPv6 and we're going to always use the routing tables soon. ok florian@, man pages ok jmc@ --- usr.sbin/traceroute/traceroute.8 | 17 +++-------------- usr.sbin/traceroute/traceroute.c | 12 +++--------- usr.sbin/traceroute6/traceroute6.8 | 17 +++-------------- usr.sbin/traceroute6/traceroute6.c | 15 +++------------ 4 files changed, 12 insertions(+), 49 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/traceroute/traceroute.8 b/usr.sbin/traceroute/traceroute.8 index 037f96e1c20..9c924b3b516 100644 --- a/usr.sbin/traceroute/traceroute.8 +++ b/usr.sbin/traceroute/traceroute.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: traceroute.8,v 1.52 2014/02/26 20:52:29 claudio Exp $ +.\" $OpenBSD: traceroute.8,v 1.53 2014/03/24 11:11:49 mpi Exp $ .\" $NetBSD: traceroute.8,v 1.6 1995/10/12 03:05:50 mycroft Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 @@ -33,7 +33,7 @@ .\" .\" @(#)traceroute.8 8.1 (Berkeley) 6/6/93 .\" -.Dd $Mdocdate: February 26 2014 $ +.Dd $Mdocdate: March 24 2014 $ .Dt TRACEROUTE 8 .Os .Sh NAME @@ -42,7 +42,7 @@ .Sh SYNOPSIS .Nm traceroute .Bk -words -.Op Fl AcDdIlnrSvx +.Op Fl AcDdIlnSvx .Op Fl f Ar first_ttl .Op Fl g Ar gateway_addr .Op Fl m Ar max_ttl @@ -151,17 +151,6 @@ to pick an unused port range. Set the number of probes per ``ttl'' to .Ar nqueries (default is three probes). -.It Fl r -Bypass the normal routing tables and send directly to a host on an attached -network. -If the host is not on a directly attached network, -an error is returned. -This option corresponds to the -.Dv SO_DONTROUTE -socket option; -it can be used to ping a local host through an interface -that has no route through it -(e.g., after the interface was dropped by a routing daemon). .It Fl S Print how many probes were not answered for each hop. .It Fl s Ar src_addr diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c index 97e427e4078..16f6b556c04 100644 --- a/usr.sbin/traceroute/traceroute.c +++ b/usr.sbin/traceroute/traceroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: traceroute.c,v 1.94 2014/03/18 10:11:36 florian Exp $ */ +/* $OpenBSD: traceroute.c,v 1.95 2014/03/24 11:11:49 mpi Exp $ */ /* $NetBSD: traceroute.c,v 1.10 1995/05/21 15:50:45 mycroft Exp $ */ /*- @@ -328,7 +328,7 @@ main(int argc, char *argv[]) (void) sysctl(mib, sizeof(mib)/sizeof(mib[0]), &max_ttl, &size, NULL, 0); - while ((ch = getopt(argc, argv, "AcDdf:g:Ilm:nP:p:q:rSs:t:V:vw:x")) + while ((ch = getopt(argc, argv, "AcDdf:g:Ilm:nP:p:q:Ss:t:V:vw:x")) != -1) switch (ch) { case 'A': @@ -421,9 +421,6 @@ main(int argc, char *argv[]) errx(1, "nprobes must be >0."); nprobes = (int)l; break; - case 'r': - options |= SO_DONTROUTE; - break; case 's': /* * set the ip source address of the outbound @@ -581,9 +578,6 @@ main(int argc, char *argv[]) if (options & SO_DEBUG) (void) setsockopt(sndsock, SOL_SOCKET, SO_DEBUG, (char *)&on, sizeof(on)); - if (options & SO_DONTROUTE) - (void) setsockopt(sndsock, SOL_SOCKET, SO_DONTROUTE, - (char *)&on, sizeof(on)); if (source) { (void) memset(&from, 0, sizeof(struct sockaddr)); @@ -1310,7 +1304,7 @@ usage(void) extern char *__progname; fprintf(stderr, - "usage: %s [-AcDdIlnrSvx] [-f first_ttl] [-g gateway_addr] [-m max_ttl]\n" + "usage: %s [-AcDdIlnSvx] [-f first_ttl] [-g gateway_addr] [-m max_ttl]\n" "\t[-P proto] [-p port] [-q nqueries] [-s src_addr] [-t toskeyword]\n" "\t[-V rtable] [-w waittime] host [packetsize]\n", __progname); exit(1); diff --git a/usr.sbin/traceroute6/traceroute6.8 b/usr.sbin/traceroute6/traceroute6.8 index 1eac65ffeaf..90fdf51e268 100644 --- a/usr.sbin/traceroute6/traceroute6.8 +++ b/usr.sbin/traceroute6/traceroute6.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: traceroute6.8,v 1.21 2014/03/18 10:06:39 florian Exp $ +.\" $OpenBSD: traceroute6.8,v 1.22 2014/03/24 11:11:49 mpi Exp $ .\" $KAME: traceroute6.8,v 1.9 2002/08/30 03:56:20 onoe Exp $ .\" .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: March 18 2014 $ +.Dd $Mdocdate: March 24 2014 $ .Dt TRACEROUTE6 8 .Os .\" @@ -38,7 +38,7 @@ .\" .Sh SYNOPSIS .Nm traceroute6 -.Op Fl AcDdIlnrSv +.Op Fl AcDdIlnSv .Op Fl f Ar firsthop .Op Fl g Ar gateway .Op Fl m Ar hoplimit @@ -93,17 +93,6 @@ Set UDP port number to .It Fl q Ar probes Set the number of probes per hop count to .Ar probes . -.It Fl r -Bypass the normal routing tables and send directly to a host on an attached -network. -If the host is not on a directly attached network, -an error is returned. -This option corresponds to the -.Dv SO_DONTROUTE -socket option; -it can be used to ping a local host through an interface -that has no route through it -(e.g. after the interface was dropped by a routing daemon). .It Fl S Print how many probes were not answered for each hop. .It Fl s Ar src diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c index 0013438c487..100f6ce7806 100644 --- a/usr.sbin/traceroute6/traceroute6.c +++ b/usr.sbin/traceroute6/traceroute6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: traceroute6.c,v 1.67 2014/03/18 10:11:36 florian Exp $ */ +/* $OpenBSD: traceroute6.c,v 1.68 2014/03/24 11:11:49 mpi Exp $ */ /* $KAME: traceroute6.c,v 1.63 2002/10/24 12:53:25 itojun Exp $ */ /* @@ -379,7 +379,7 @@ main(int argc, char *argv[]) seq = 0; - while ((ch = getopt(argc, argv, "AcDdf:g:Ilm:np:q:rSs:w:vV:")) != -1) + while ((ch = getopt(argc, argv, "AcDdf:g:Ilm:np:q:Ss:w:vV:")) != -1) switch (ch) { case 'A': Aflag++; @@ -466,9 +466,6 @@ main(int argc, char *argv[]) errx(1, "nprobes must be >0."); nprobes = (int)l; break; - case 'r': - options |= SO_DONTROUTE; - break; case 's': /* * set the ip source address of the outbound @@ -585,9 +582,6 @@ main(int argc, char *argv[]) if (options & SO_DEBUG) (void) setsockopt(rcvsock, SOL_SOCKET, SO_DEBUG, (char *)&on, sizeof(on)); - if (options & SO_DONTROUTE) - (void) setsockopt(rcvsock, SOL_SOCKET, SO_DONTROUTE, - (char *)&on, sizeof(on)); /* * Send UDP or ICMP @@ -611,9 +605,6 @@ main(int argc, char *argv[]) if (options & SO_DEBUG) (void) setsockopt(sndsock, SOL_SOCKET, SO_DEBUG, (char *)&on, sizeof(on)); - if (options & SO_DONTROUTE) - (void) setsockopt(sndsock, SOL_SOCKET, SO_DONTROUTE, - (char *)&on, sizeof(on)); if (rth) {/* XXX: there is no library to finalize the header... */ rth->ip6r_len = rth->ip6r_segleft * 2; if (setsockopt(sndsock, IPPROTO_IPV6, IPV6_RTHDR, @@ -1221,7 +1212,7 @@ usage(void) { fprintf(stderr, -"usage: traceroute6 [-AcDdIlnrSv] [-f firsthop] [-g gateway] [-m hoplimit]\n" +"usage: traceroute6 [-AcDdIlnSv] [-f firsthop] [-g gateway] [-m hoplimit]\n" " [-p port] [-q probes] [-s src] [-V rtableid] [-w waittime]\n" " host [datalen]\n"); exit(1); -- cgit v1.2.3