diff options
author | Alan Somers <asomers@FreeBSD.org> | 2019-08-21 14:52:12 +0000 |
---|---|---|
committer | Alan Somers <asomers@FreeBSD.org> | 2019-08-21 14:52:12 +0000 |
commit | 229e8bf2bb1e8367120402f75793a43af7b430cd (patch) | |
tree | 742cc5b84ce0b9d4acc7f0dc049fce8601724ce3 /sbin | |
parent | 6d7adebad52252d8c7672fb0ddc0d3f3ad1215bb (diff) | |
download | src-229e8bf2bb1e8367120402f75793a43af7b430cd.tar.gz src-229e8bf2bb1e8367120402f75793a43af7b430cd.zip |
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
Notes
Notes:
svn path=/head/; revision=351330
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ping/ping.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 4375c72322b8..d04ab651351a 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1168,8 +1168,7 @@ pr_pack(char *buf, int cc, struct sockaddr_in *from, struct timespec *tv) (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); |