From: Aaron Lipinski Date: Sun, 28 Jul 2019 10:35:39 +0000 (+1200) Subject: show resolved hostname in raw dnsline X-Git-Tag: v0.94~21^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fab26eacaf5484b8dcb4c14084d5d69e7266240f;p=thirdparty%2Fmtr.git show resolved hostname in raw dnsline --- diff --git a/ui/dns.c b/ui/dns.c index 8b323ff..bc79b1a 100644 --- a/ui/dns.c +++ b/ui/dns.c @@ -277,7 +277,7 @@ char *dns_lookup2( if (r->name) return r->name; else - return strlongip(ctl, ip); + return NULL; } else { r = xmalloc(sizeof(struct dns_results)); memcpy(&r->ip, ip, sizeof(r->ip)); @@ -289,7 +289,7 @@ char *dns_lookup2( if (rv < 0) error(0, errno, "couldn't write to resolver process"); } - return strlongip(ctl, ip); + return NULL; } @@ -302,7 +302,7 @@ char *dns_lookup( if (!ctl->dns || !ctl->use_dns) return NULL; t = dns_lookup2(ctl, ip); - return t; + return t ? t : strlongip(ctl, ip); } /* XXX check if necessary/exported. */