Index: vino/ChangeLog =================================================================== --- vino.orig/ChangeLog 2006-10-20 08:23:35.000000000 +0100 +++ vino.orig/ChangeLog 2006-10-20 08:23:35.000000000 +0100 @@ -0,0 +0,6 @@ +2006-10-20 Mark McLoughlin + + * vino/capplet/vino-preferences.c: + (vino_preferences_get_local_hostname): use getaddrinfo() + instead of gethostbyname() + Index: vino/capplet/vino-preferences.c =================================================================== --- vino.orig/capplet/vino-preferences.c 2006-10-17 10:00:26.000000000 +0100 +++ vino.orig/capplet/vino-preferences.c 2006-10-17 10:00:26.000000000 +0100 @@ -775,18 +775,27 @@ vino_preferences_dialog_setup_icons (Vin static char * vino_preferences_get_local_hostname (void) { - static char local_host [NI_MAXHOST] = { 0, }; + static char local_host [NI_MAXHOST] = { 0, }; + struct addrinfo hints; + struct addrinfo *results; + char *retval; - if (gethostname (local_host, NI_MAXHOST) != -1) - { - struct hostent *host; - - host = gethostbyname (local_host); + if (gethostname (local_host, NI_MAXHOST) == -1) + return NULL; - return g_strdup (host ? host->h_name : local_host); - } + memset (&hints, 0, sizeof (hints)); + hints.ai_flags = AI_CANONNAME; + + results = NULL; + if (getaddrinfo (local_host, NULL, &hints, &results) != 0) + return NULL; + + retval = g_strdup (results ? results->ai_canonname : local_host); + + if (results) + freeaddrinfo (results); - return NULL; + return retval; } static char *