diff options
author | 2014-03-24 11:11:49 +0000 | |
---|---|---|
committer | 2014-03-24 11:11:49 +0000 | |
commit | 86eee396c7a5175bc7fd84f9ac24947d8647baf6 (patch) | |
tree | 0cebe00fc55c483ddefb3cffd018e3c70da59499 | |
parent | bcopy to memcpy (diff) | |
download | wireguard-openbsd-86eee396c7a5175bc7fd84f9ac24947d8647baf6.tar.xz wireguard-openbsd-86eee396c7a5175bc7fd84f9ac24947d8647baf6.zip |
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@
-rw-r--r-- | sbin/ping/ping.8 | 12 | ||||
-rw-r--r-- | sbin/ping/ping.c | 14 | ||||
-rw-r--r-- | usr.sbin/traceroute/traceroute.8 | 17 | ||||
-rw-r--r-- | usr.sbin/traceroute/traceroute.c | 12 | ||||
-rw-r--r-- | usr.sbin/traceroute6/traceroute6.8 | 17 | ||||
-rw-r--r-- | usr.sbin/traceroute6/traceroute6.c | 15 |
6 files changed, 19 insertions, 68 deletions
diff --git a/sbin/ping/ping.8 b/sbin/ping/ping.8 index 09215d30d40..dd39e6699e5 100644 --- a/sbin/ping/ping.8 +++ b/sbin/ping/ping.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ping.8,v 1.51 2014/03/13 09:07:01 jmc Exp $ +.\" $OpenBSD: ping.8,v 1.52 2014/03/24 11:11:49 mpi Exp $ .\" $NetBSD: ping.8,v 1.10 1995/12/31 04:55:35 ghudson Exp $ .\" .\" Copyright (c) 1985, 1991, 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)ping.8 8.2 (Berkeley) 12/11/93 .\" -.Dd $Mdocdate: March 13 2014 $ +.Dd $Mdocdate: March 24 2014 $ .Dt PING 8 .Os .Sh NAME @@ -39,7 +39,7 @@ .Sh SYNOPSIS .Nm ping .Bk -words -.Op Fl DdEefLnqRrv +.Op Fl DdEefLnqRv .Op Fl c Ar count .Op Fl I Ar ifaddr .Op Fl i Ar wait @@ -171,12 +171,6 @@ packet, .Nm will print the route list and then truncate it at the correct spot. Many hosts ignore or discard this option. -.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 can be used to ping a local host through an interface -that has no route through it. .It Fl s Ar packetsize Specifies the number of data bytes to be sent. The default is 56, diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 6170e7e83de..6a13a86e59f 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping.c,v 1.99 2014/01/10 21:57:44 florian Exp $ */ +/* $OpenBSD: ping.c,v 1.100 2014/03/24 11:11:49 mpi Exp $ */ /* $NetBSD: ping.c,v 1.20 1995/08/11 22:37:58 cgd Exp $ */ /* @@ -100,7 +100,7 @@ int options; #define F_QUIET 0x0010 #define F_RROUTE 0x0020 #define F_SO_DEBUG 0x0040 -#define F_SO_DONTROUTE 0x0080 +/* 0x0080 */ #define F_VERBOSE 0x0100 #define F_SADDR 0x0200 #define F_HDRINCL 0x0400 @@ -203,7 +203,7 @@ main(int argc, char *argv[]) preload = 0; datap = &outpack[8 + sizeof(struct tv32)]; while ((ch = getopt(argc, argv, - "DEI:LRS:c:defi:l:np:qrs:T:t:V:vw:")) != -1) + "DEI:LRS:c:defi:l:np:qs:T:t:V:vw:")) != -1) switch(ch) { case 'c': npackets = (unsigned long)strtonum(optarg, 0, @@ -283,9 +283,6 @@ main(int argc, char *argv[]) case 'R': options |= F_RROUTE; break; - case 'r': - options |= F_SO_DONTROUTE; - break; case 's': /* size of packet to send */ datalen = (unsigned int)strtonum(optarg, 0, MAXPAYLOAD, &errstr); if (errstr) @@ -403,9 +400,6 @@ main(int argc, char *argv[]) if (options & F_SO_DEBUG) (void)setsockopt(s, SOL_SOCKET, SO_DEBUG, &hold, sizeof(hold)); - if (options & F_SO_DONTROUTE) - (void)setsockopt(s, SOL_SOCKET, SO_DONTROUTE, &hold, - sizeof(hold)); if (options & F_TTL) { if (IN_MULTICAST(ntohl(to->sin_addr.s_addr))) @@ -1420,7 +1414,7 @@ void usage(void) { (void)fprintf(stderr, - "usage: ping [-DdEefLnqRrv] [-c count] [-I ifaddr] [-i wait]\n" + "usage: ping [-DdEefLnqRv] [-c count] [-I ifaddr] [-i wait]\n" "\t[-l preload] [-p pattern] [-s packetsize]" #ifndef SMALL " [-T toskeyword]" 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); |