Date: Wed, 21 Aug 2019 14:52:13 +0000 (UTC) From: Alan Somers <asomers@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351330 - head/sbin/ping Message-ID: <201908211452.x7LEqDJt036967@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: asomers Date: Wed Aug 21 14:52:12 2019 New Revision: 351330 URL: https://svnweb.freebsd.org/changeset/base/351330 Log: ping: do reverse DNS lookup of the target address When printing replies, ping will now attempt a reverse DNS lookup of the target. That can be suppressed by using the "-n" option. Curiously, ping has always done reverse lookups in certain error paths, but never in the success path. Submitted by: Ján Sučan <sucanjan@gmail.com> MFC after: 2 weeks Sponsored by: Google LLC (Google Summer of Code 2019) Differential Revision: https://reviews.freebsd.org/D21351 Modified: head/sbin/ping/ping.c Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Wed Aug 21 10:54:52 2019 (r351329) +++ head/sbin/ping/ping.c Wed Aug 21 14:52:12 2019 (r351330) @@ -1168,8 +1168,7 @@ pr_pack(char *buf, int cc, struct sockaddr_in *from, s (void)write(STDOUT_FILENO, &BSPACE, 1); else { (void)printf("%d bytes from %s: icmp_seq=%u", cc, - inet_ntoa(*(struct in_addr *)&from->sin_addr.s_addr), - seq); + pr_addr(from->sin_addr), seq); (void)printf(" ttl=%d", ip->ip_ttl); if (timing) (void)printf(" time=%.3f ms", triptime);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908211452.x7LEqDJt036967>