Skip to content

Commit

Permalink
traceroute6: remove -l flag
Browse files Browse the repository at this point in the history
The -l flag was used to tell traceroute6(8) to show both hostname and
address for each hop.  However, traceroute(8) already does this by
default, and there's no reason for traceroute6 to behave differently.

Make this the default behaviour, and accept -l for backward
compatibility as a no-op flag.
  • Loading branch information
llfw committed Jan 11, 2024
1 parent aa1223a commit d2e88d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
9 changes: 1 addition & 8 deletions usr.sbin/traceroute6/traceroute6.8
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,7 @@ tries to use routing headers.
.It Fl I
Use ICMP6 ECHO instead of UDP datagrams.
.It Fl l
Print both host hostnames and numeric addresses.
Normally
.Nm
prints only hostnames if
.Fl n
is not specified, and only numeric addresses if
.Fl n
is specified.
Ignored for backward compatibility.
.It Fl m Ar hoplimit
Specify maximum hoplimit, up to 255.
The default is the value of the
Expand Down
6 changes: 1 addition & 5 deletions usr.sbin/traceroute6/traceroute6.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ static int verbose;
static int waittime = 5; /* time to wait for response (in seconds) */
static int nflag; /* print addresses numerically */
static int useproto = IPPROTO_UDP; /* protocol to use to send packet */
static int lflag; /* print both numerical address & hostname */
static int as_path; /* print as numbers for each hop */
static int ecnflag; /* ECN bleaching detection flag */
static char *as_server = NULL;
Expand Down Expand Up @@ -462,7 +461,6 @@ main(int argc, char *argv[])
useproto = IPPROTO_ICMPV6;
break;
case 'l':
lflag++;
break;
case 'm':
ep = NULL;
Expand Down Expand Up @@ -1584,10 +1582,8 @@ print(struct msghdr *mhdr, int cc)
printf(" [AS%u]", as_lookup(asn, hbuf, AF_INET6));
if (nflag)
printf(" %s", hbuf);
else if (lflag)
printf(" %s (%s)", inetname((struct sockaddr *)from), hbuf);
else
printf(" %s", inetname((struct sockaddr *)from));
printf(" %s (%s)", inetname((struct sockaddr *)from), hbuf);

if (verbose) {
#ifdef OLDRAWSOCKET
Expand Down

0 comments on commit d2e88d0

Please sign in to comment.