From: florian Date: Fri, 18 Apr 2014 16:48:19 +0000 (+0000) Subject: Drop rh0 support (-g), it doesn't work anyway. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0e827d159b3da8bf8cc99cfb674e552ec140916f;p=openbsd Drop rh0 support (-g), it doesn't work anyway. OK benno@ --- diff --git a/usr.sbin/traceroute6/traceroute6.8 b/usr.sbin/traceroute6/traceroute6.8 index 90fdf51e268..ba4f7989bb0 100644 --- a/usr.sbin/traceroute6/traceroute6.8 +++ b/usr.sbin/traceroute6/traceroute6.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: traceroute6.8,v 1.22 2014/03/24 11:11:49 mpi Exp $ +.\" $OpenBSD: traceroute6.8,v 1.23 2014/04/18 16:48:19 florian 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 24 2014 $ +.Dd $Mdocdate: April 18 2014 $ .Dt TRACEROUTE6 8 .Os .\" @@ -40,7 +40,6 @@ .Nm traceroute6 .Op Fl AcDdIlnSv .Op Fl f Ar firsthop -.Op Fl g Ar gateway .Op Fl m Ar hoplimit .Op Fl p Ar port .Op Fl q Ar probes @@ -72,12 +71,6 @@ Dump the packet data to standard error before transmitting it. Debug mode. .It Fl f Ar firsthop Specify how many hops to skip. -.It Fl g Ar gateway -Specify an intermediate gateway -.Po -.Nm -uses a routing header -.Pc . .It Fl I Use ICMP6 ECHO instead of UDP datagrams. .It Fl l diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c index 1e4de426ab9..57308ff0186 100644 --- a/usr.sbin/traceroute6/traceroute6.c +++ b/usr.sbin/traceroute6/traceroute6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: traceroute6.c,v 1.79 2014/04/18 16:33:21 florian Exp $ */ +/* $OpenBSD: traceroute6.c,v 1.80 2014/04/18 16:48:19 florian Exp $ */ /* $KAME: traceroute6.c,v 1.63 2002/10/24 12:53:25 itojun Exp $ */ /* @@ -308,9 +308,6 @@ struct in6_pktinfo *rcvpktinfo; int datalen; /* How much data */ #define ICMP6ECHOLEN 8 -/* XXX: 2064 = 127(max hops in type 0 rthdr) * sizeof(ip6_hdr) + 16(margin) */ -char rtbuf[2064]; -struct ip6_rthdr *rth; char *source = 0; char *hostname; @@ -376,7 +373,7 @@ main(int argc, char *argv[]) seq = 0; - while ((ch = getopt(argc, argv, "AcDdf:g:Ilm:np:q:Ss:w:vV:")) != -1) + while ((ch = getopt(argc, argv, "AcDdf:Ilm:np:q:Ss:w:vV:")) != -1) switch (ch) { case 'A': Aflag++; @@ -398,35 +395,6 @@ main(int argc, char *argv[]) errx(1, "firsthop must be 1 to %u.", max_hops); first_hop = (u_int8_t)l; break; - case 'g': - hp = getipnodebyname(optarg, AF_INET6, 0, &h_errno); - if (hp == NULL) { - fprintf(stderr, - "traceroute6: unknown host %s\n", optarg); - exit(1); - } - 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) { - fprintf(stderr, - "inet6_rth_init failed.\n"); - exit(1); - } - } - if (inet6_rth_add((void *)rth, - (struct in6_addr *)hp->h_addr)) { - fprintf(stderr, - "inet6_rth_add failed for %s\n", - optarg); - exit(1); - } - freehostent(hp); - break; case 'I': useicmp++; ident = htons(getpid() & 0xffff); /* same as ping6 */ @@ -598,15 +566,6 @@ main(int argc, char *argv[]) if (options & SO_DEBUG) (void) setsockopt(sndsock, SOL_SOCKET, SO_DEBUG, (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, - (void *)rth, (rth->ip6r_len + 1) << 3)) { - fprintf(stderr, "setsockopt(IPV6_RTHDR): %s\n", - strerror(errno)); - exit(1); - } - } /* * Source selection @@ -1208,7 +1167,7 @@ usage(void) { fprintf(stderr, -"usage: traceroute6 [-AcDdIlnSv] [-f firsthop] [-g gateway] [-m hoplimit]\n" +"usage: traceroute6 [-AcDdIlnSv] [-f firsthop] [-m hoplimit]\n" " [-p port] [-q probes] [-s src] [-V rtableid] [-w waittime]\n" " host [datalen]\n"); exit(1);