Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/traceroute6 Remove the "-g" option, it uses RH0, wh...



details:   https://anonhg.NetBSD.org/src/rev/dda526e17563
branches:  trunk
changeset: 322189:dda526e17563
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon Apr 23 06:42:02 2018 +0000

description:
Remove the "-g" option, it uses RH0, which is deprecated by RFC5095, and
doesn't work on modern networks anymore.

diffstat:

 usr.sbin/traceroute6/traceroute6.8 |  10 +-------
 usr.sbin/traceroute6/traceroute6.c |  42 ++++---------------------------------
 2 files changed, 7 insertions(+), 45 deletions(-)

diffs (122 lines):

diff -r f869e9065075 -r dda526e17563 usr.sbin/traceroute6/traceroute6.8
--- a/usr.sbin/traceroute6/traceroute6.8        Mon Apr 23 01:35:25 2018 +0000
+++ b/usr.sbin/traceroute6/traceroute6.8        Mon Apr 23 06:42:02 2018 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: traceroute6.8,v 1.17 2017/08/05 20:24:17 wiz Exp $
+.\"    $NetBSD: traceroute6.8,v 1.18 2018/04/23 06:42:02 maxv Exp $
 .\"    $KAME: traceroute6.8,v 1.8 2000/06/12 16:29:18 itojun 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 January 18, 2007
+.Dd April 23, 2018
 .Dt TRACEROUTE6 8
 .Os
 .\"
@@ -74,12 +74,6 @@
 Turn on socket-level debugging.
 .It Fl f Ar firsthop
 Specify how many hops to skip in trace.
-.It Fl g Ar gateway
-Specify intermediate gateway
-.Po
-.Nm
-uses routing header
-.Pc .
 .It Fl I
 Use ICMP6 ECHO instead of UDP datagrams.
 .It Fl l
diff -r f869e9065075 -r dda526e17563 usr.sbin/traceroute6/traceroute6.c
--- a/usr.sbin/traceroute6/traceroute6.c        Mon Apr 23 01:35:25 2018 +0000
+++ b/usr.sbin/traceroute6/traceroute6.c        Mon Apr 23 06:42:02 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: traceroute6.c,v 1.44 2016/11/17 09:21:34 shm Exp $     */
+/*     $NetBSD: traceroute6.c,v 1.45 2018/04/23 06:42:02 maxv Exp $    */
 /*     $KAME: traceroute6.c,v 1.67 2004/01/25 03:24:39 itojun Exp $    */
 
 /*
@@ -75,7 +75,7 @@
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: traceroute6.c,v 1.44 2016/11/17 09:21:34 shm Exp $");
+__RCSID("$NetBSD: traceroute6.c,v 1.45 2018/04/23 06:42:02 maxv Exp $");
 #endif
 #endif
 
@@ -340,8 +340,6 @@
 static struct sockaddr_in6 Src, Dst, Rcv;
 static u_long datalen;                 /* How much data */
 #define        ICMP6ECHOLEN    8
-/* XXX: 2064 = 127(max hops in type 0 rthdr) * sizeof(ip6_hdr) + 16(margin) */
-static char rtbuf[2064];
 #ifdef USE_RFC3542
 static struct ip6_rthdr *rth;
 #endif
@@ -376,7 +374,6 @@
        struct addrinfo hints, *res;
        static u_char *rcvcmsgbuf;
        u_long probe, hops, lport;
-       struct hostent *hp;
        size_t size;
 
        /*
@@ -417,7 +414,7 @@
 
        seq = 0;
 
-       while ((ch = getopt(argc, argv, "aA:df:g:Ilm:np:q:rs:w:v")) != -1)
+       while ((ch = getopt(argc, argv, "aA:df:Ilm:np:q:rs:w:v")) != -1)
                switch (ch) {
                case 'a':
                        as_path = 1;
@@ -436,35 +433,6 @@
                        if (errno || !*optarg || *ep|| first_hop > 255)
                                errx(1, "Invalid min hoplimit `%s'", optarg);
                        break;
-               case 'g':
-                       hp = getipnodebyname(optarg, AF_INET6, 0, &h_errno);
-                       if (hp == NULL)
-                               errx(1, "Unknown host `%s'", optarg);
-#ifdef USE_RFC3542
-                       if (rth == NULL) {
-                               /*
-                                * XXX: We can't detect the number of
-                                * intermediate nodes yet.
-                                */
-                               if ((rth = inet6_rth_init((void *)rtbuf,
-                                   sizeof(rtbuf), IPV6_RTHDR_TYPE_0,
-                                   0)) == NULL) {
-                                       errx(1, "inet6_rth_init failed");
-                               }
-                       }
-                       if (inet6_rth_add((void *)rth,
-                           (struct in6_addr *)hp->h_addr))
-                               errx(1, "inet6_rth_add failed for `%s'",
-                                   optarg);
-#else  /* old advanced API */
-                       if (cmsg == NULL)
-                               cmsg = inet6_rthdr_init(rtbuf,
-                                   IPV6_RTHDR_TYPE_0);
-                       inet6_rthdr_add(cmsg, (struct in6_addr *)hp->h_addr,
-                           IPV6_RTHDR_LOOSE);
-#endif
-                       freehostent(hp);
-                       break;
                case 'I':
                        useicmp++;
                        /* same as ping6 */
@@ -1300,8 +1268,8 @@
 {
 
        fprintf(stderr,
-"Usage: %s [-adIlnrv] [-A as_server] [-f firsthop] [-g gateway]\n"
-"\t[-m hoplimit] [-p port] [-q probes] [-s src] [-w waittime] target [datalen]\n",
+"Usage: %s [-adIlnrv] [-A as_server] [-f firsthop] [-m hoplimit]\n"
+"\t[-p port] [-q probes] [-s src] [-w waittime] target [datalen]\n",
        getprogname());
        exit(1);
 }



Home | Main Index | Thread Index | Old Index