traceroute6: remove -l flag

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.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1023
This commit is contained in:
Lexi Winter 2024-02-02 14:46:14 -07:00 committed by Warner Losh
parent e0c4386e7e
commit 0a49be722f
2 changed files with 3 additions and 14 deletions

View file

@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd October 25, 2023
.Dd February 2, 2024
.Dt TRACEROUTE6 8
.Os
.\"
@ -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

View file

@ -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;
@ -462,7 +461,6 @@ main(int argc, char *argv[])
useproto = IPPROTO_ICMPV6;
break;
case 'l':
lflag++;
break;
case 'm':
ep = NULL;
@ -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