]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
switch gui to addrinfo
authorAaron Lipinski <kris.lipinski@gmail.com>
Tue, 6 Apr 2021 04:52:18 +0000 (16:52 +1200)
committerAaron Lipinski <aaron.lipinski@roboticsplus.co.nz>
Thu, 8 Apr 2021 20:36:25 +0000 (08:36 +1200)
ui/gtk.c

index a98154afe660118e84c699e1d4796f6efb6025a5..aa07324c00510679d268ae14cd181cfa83811474 100644 (file)
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -244,11 +244,11 @@ static gint Host_activate(
     gpointer data)
 {
     struct mtr_ctl *ctl = (struct mtr_ctl *) data;
-    struct hostent *addr;
+    struct addrinfo *res = NULL;
 
-    addr = gethostbyname(gtk_entry_get_text(GTK_ENTRY(entry)));
-    if (addr) {
-        net_reopen(ctl, addr);
+    ctl->Hostname = gtk_entry_get_text(GTK_ENTRY(entry));
+    if (get_hostent_from_name(ctl, &res, ctl->Hostname) == 0) {
+        net_reopen(ctl, res);
         net_send_batch(ctl);
         /* If we are "Paused" at this point it is usually because someone
            entered a non-existing host. Therefore do the go-ahead... */