From: Aaron Lipinski Date: Tue, 6 Apr 2021 04:52:18 +0000 (+1200) Subject: switch gui to addrinfo X-Git-Tag: v0.95~6^2~6 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=6a8471e48d33a9017ed226d2f6084e655421a793;p=thirdparty%2Fmtr.git switch gui to addrinfo --- diff --git a/ui/gtk.c b/ui/gtk.c index a98154a..aa07324 100644 --- 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... */