git: 0a49be722fe0 - main - traceroute6: remove -l flag
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 02 Feb 2024 21:50:21 UTC
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0a49be722fe0cf84c55eb148348499bf66de6ae7 commit 0a49be722fe0cf84c55eb148348499bf66de6ae7 Author: Lexi Winter <lexi@le-Fay.ORG> AuthorDate: 2024-02-02 21:46:14 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-02-02 21:49:13 +0000 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 --- usr.sbin/traceroute6/traceroute6.8 | 11 ++--------- usr.sbin/traceroute6/traceroute6.c | 6 +----- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/usr.sbin/traceroute6/traceroute6.8 b/usr.sbin/traceroute6/traceroute6.8 index 13917eb47c7f..1d71895fcde3 100644 --- a/usr.sbin/traceroute6/traceroute6.8 +++ b/usr.sbin/traceroute6/traceroute6.8 @@ -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 diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c index 212564415d6c..15aab51ac234 100644 --- a/usr.sbin/traceroute6/traceroute6.c +++ b/usr.sbin/traceroute6/traceroute6.c @@ -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