diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/gdm-address.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/common/gdm-address.c b/common/gdm-address.c index 34480380..a8b73e28 100644 --- a/common/gdm-address.c +++ b/common/gdm-address.c @@ -220,14 +220,13 @@ 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,13 +236,14 @@ _gdm_address_debug (GdmAddress *address, void gdm_address_debug (GdmAddress *address) { - char *hostname; - char *host; - char *port; + char *hostname = NULL; + char *host = NULL; + char *port = NULL; - gdm_address_get_hostname (address, &hostname); gdm_address_get_numeric_info (address, &host, &port); + _gdm_address_debug (address, host, port); + g_free (hostname); g_free (host); g_free (port); @@ -277,7 +277,8 @@ gdm_address_get_hostname (GdmAddress *address, 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 +319,7 @@ gdm_address_get_numeric_info (GdmAddress *address, 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 +405,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 +436,8 @@ 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; |