]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
show resolved hostname in raw dnsline
authorAaron Lipinski <kris.lipinski@gmail.com>
Sun, 28 Jul 2019 10:35:39 +0000 (22:35 +1200)
committerAaron Lipinski <kris.lipinski@gmail.com>
Thu, 8 Aug 2019 09:38:57 +0000 (21:38 +1200)
ui/dns.c

index 8b323ff282509cb4c03afbdc48005e6fa1a05ca9..bc79b1adae0c3cc82ec3c32e13ac182df0f44375 100644 (file)
--- 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. */