From owner-svn-src-head@freebsd.org Thu Aug 22 18:57:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 21726CF0C7; Thu, 22 Aug 2019 18:57:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Dv0k03ptz3HLr; Thu, 22 Aug 2019 18:57:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDFE9884D; Thu, 22 Aug 2019 18:57:25 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7MIvPf9040378; Thu, 22 Aug 2019 18:57:25 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7MIvPuN040376; Thu, 22 Aug 2019 18:57:25 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201908221857.x7MIvPuN040376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 22 Aug 2019 18:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351398 - in head/sbin/ping: . tests X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/sbin/ping: . tests X-SVN-Commit-Revision: 351398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2019 18:57:26 -0000 Author: asomers Date: Thu Aug 22 18:57:24 2019 New Revision: 351398 URL: https://svnweb.freebsd.org/changeset/base/351398 Log: ping: By default, don't reverse lookup IP addresses ping's default is now not to attempt reverse DNS lookups. The -H flag will enable them. This change is not quite a reversion of r351330. That change made the happy path and error path do reverse lookups consistently; this change changes the default for both paths. Submitted by: Ján Sučan Discussed with: cem MFC after: 2 weeks MFC-With: 351330 Sponsored by: Google LLC (Google Summer of Code 2019) Differential Revision: https://reviews.freebsd.org/D21364 Modified: head/sbin/ping/ping.8 head/sbin/ping/ping.c head/sbin/ping/tests/ping_c1_s56_t1.out Modified: head/sbin/ping/ping.8 ============================================================================== --- head/sbin/ping/ping.8 Thu Aug 22 18:52:30 2019 (r351397) +++ head/sbin/ping/ping.8 Thu Aug 22 18:57:24 2019 (r351398) @@ -28,7 +28,7 @@ .\" @(#)ping.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd August 21, 2019 +.Dd August 22, 2019 .Dt PING 8 .Os .Sh NAME @@ -160,11 +160,9 @@ The default value is 0. .It Fl H Hostname output. Try to do a reverse DNS lookup when displaying addresses. -This is the opposite of -.Fl n , -and it is the default behavior. -.Nm -utility tries reverse-lookup by default. +This is the opposite of the +.Fl n +option. .It Fl h Ar sweepincrsize Specify the number of bytes to increment the size of .Tn ICMP @@ -228,6 +226,9 @@ MIB variable. .It Fl n Numeric output only. No attempt will be made to lookup symbolic names for host addresses. +This is the opposite of +.Fl H , +and it is the default behavior. .It Fl o Exit successfully after receiving one reply packet. .It Fl P Ar policy Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Thu Aug 22 18:52:30 2019 (r351397) +++ head/sbin/ping/ping.c Thu Aug 22 18:57:24 2019 (r351398) @@ -261,6 +261,8 @@ main(int argc, char *const *argv) #endif cap_rights_t rights; + options |= F_NUMERIC; + /* * Do the stuff that we need root priv's for *first*, and * then drop our setuid bit. Save error reporting for Modified: head/sbin/ping/tests/ping_c1_s56_t1.out ============================================================================== --- head/sbin/ping/tests/ping_c1_s56_t1.out Thu Aug 22 18:52:30 2019 (r351397) +++ head/sbin/ping/tests/ping_c1_s56_t1.out Thu Aug 22 18:57:24 2019 (r351398) @@ -1,5 +1,5 @@ PING localhost: 56 data bytes -64 bytes from localhost: icmp_seq=0 ttl= time= ms +64 bytes from: icmp_seq=0 ttl= time= ms --- localhost ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss