Bugzilla – Attachment 65380 Details for
Bug 144324
No hostname in dhc/DNS setup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
same patch, new style
nm-set-hostname-non-dhcp-sscheler-02.patch (text/plain), 1.15 KB, created by
Timo Hoenig
on 2006-01-27 11:55:39 UTC
(
hide
)
Description:
same patch, new style
Filename:
MIME Type:
Creator:
Timo Hoenig
Created:
2006-01-27 11:55:39 UTC
Size:
1.15 KB
patch
obsolete
>--- a/src/backends/NetworkManagerSuSE.c 2006-01-24 12:54:21.000000000 -0700 >+++ b/src/backends/NetworkManagerSuSE.c 2006-01-27 04:11:03.000000000 -0700 >@@ -1023,6 +1023,8 @@ > { > shvarFile *file; > gchar *name, *buf, *hostname = NULL; >+ struct in_addr temp_addr; >+ struct hostent *host = NULL; > > g_return_if_fail (config != NULL); > >@@ -1035,10 +1037,26 @@ > if (!buf) > goto out_close; > >- if (!strcmp (buf, "yes")) { >+ if (!strcmp (buf, "yes")) >+ { > hostname = nm_ip4_config_get_hostname (config); >- if (hostname) { >- nm_info ("Setting hostname to %s\n", hostname); >+ if (!hostname) >+ { >+ /* try to get hostname via dns */ >+ temp_addr.s_addr = nm_ip4_config_get_address (config); >+ if ((host = gethostbyaddr ((char *)&temp_addr, sizeof (temp_addr), AF_INET)) == NULL) >+ { >+ nm_warning ("nm_system_set_hostname: gethostbyaddr failed, h_errno = %d", h_errno); >+ } >+ else >+ { >+ hostname = g_strdup (host->h_name); >+ hostname = strtok (hostname, "."); >+ } >+ } >+ if (hostname) >+ { >+ nm_info ("Setting hostname to '%s'", hostname); > if (sethostname (hostname, strlen (hostname)) < 0) > nm_warning ("Could not set hostname."); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 144324
:
65118
| 65380