File gdm-reduce-hostname-lookups.patch of Package gdm.16051

Index: b/common/gdm-address.c
===================================================================
--- a/common/gdm-address.c	2018-06-11 21:21:16.821100701 +0800
+++ b/common/gdm-address.c	2018-06-11 21:23:28.301525043 +0800
@@ -220,14 +220,12 @@ address_family_str (GdmAddress *address)
 
 static void
 _gdm_address_debug (GdmAddress *address,
-                    const char *hostname,
                     const char *host,
                     const char *port)
 {
-        g_debug ("Address family:%d (%s) hostname:%s host:%s port:%s local:%d loopback:%d",
+        g_debug ("Address family:%d (%s) host:%s port:%s local:%d loopback:%d",
                  address->ss->ss_family,
                  address_family_str (address) ? address_family_str (address) : "(null)",
-                 hostname ? hostname : "(null)",
                  host ? host : "(null)",
                  port ? port : "(null)",
                  gdm_address_is_local (address),
@@ -237,14 +235,11 @@ _gdm_address_debug (GdmAddress *address,
 void
 gdm_address_debug (GdmAddress *address)
 {
-        char *hostname;
-        char *host;
-        char *port;
+        char *host = NULL;
+        char *port = NULL;
 
-        gdm_address_get_hostname (address, &hostname);
         gdm_address_get_numeric_info (address, &host, &port);
 
-        g_free (hostname);
         g_free (host);
         g_free (port);
 }
@@ -277,7 +272,7 @@ gdm_address_get_hostname (GdmAddress *ad
                 err_msg = gai_strerror (res);
                 g_warning ("Unable to lookup hostname: %s",
                         err_msg ? err_msg : "(null)");
-                _gdm_address_debug (address, NULL, NULL, NULL);
+                _gdm_address_debug (address, NULL, NULL);
         }
 
         /* try numeric? */
@@ -318,7 +313,7 @@ gdm_address_get_numeric_info (GdmAddress
                 err_msg = gai_strerror (res);
                 g_warning ("Unable to lookup numeric info: %s",
                         err_msg ? err_msg : "(null)");
-                _gdm_address_debug (address, NULL, NULL, NULL);
+                _gdm_address_debug (address, NULL, NULL);
         } else {
                 ret = TRUE;
         }
@@ -404,8 +399,6 @@ add_local_siocgifconf (GList **list)
                                         address = gdm_address_new_from_sockaddr ((struct sockaddr *)&ifreq.ifr_addr,
                                                                                  sizeof (struct sockaddr));
 
-                                        gdm_address_debug (address);
-
                                         *list = g_list_append (*list, address);
                                 }
                         }
@@ -437,7 +430,7 @@ add_local_addrinfo (GList **list)
 
         memset (&hints, 0, sizeof (hints));
         hints.ai_family = AF_UNSPEC;
-        hints.ai_flags = AI_CANONNAME;
+        hints.ai_flags = AI_CANONNAME | AI_NUMERICHOST;
 
         g_debug ("GdmAddress: looking up hostname: %s", hostbuf);
         result = NULL;