mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 04:50:07 +01:00
policy: accept localhost hostnames if static
Prevents NetworkManager from trying to determine the transient hostname via DHCP or other means if "localhost" is already configured as a static hostname, as the transient hostname will be ignored by hostnamed if a static hostname has already been set.
This commit is contained in:
parent
21c46d6e5f
commit
152d71a1f1
2 changed files with 2 additions and 3 deletions
|
|
@ -271,8 +271,7 @@ no-auto-default=*
|
|||
Set the management mode of the hostname. This parameter will
|
||||
affect only the transient hostname. If a valid static hostname is set,
|
||||
NetworkManager will skip the update of the hostname despite the value of
|
||||
this option. An hostname empty or equal to 'localhost', 'localhost6',
|
||||
'localhost.localdomain' or 'localhost6.localdomain' is considered invalid.
|
||||
this option. A hostname empty or equal to '(none)' is considered invalid.
|
||||
</para>
|
||||
<para><literal>default</literal>: NetworkManager will update the
|
||||
hostname with the one provided via DHCP or reverse DNS lookup of the
|
||||
|
|
|
|||
|
|
@ -960,7 +960,7 @@ update_system_hostname(NMPolicy *self, const char *msg, gboolean reset_retry_int
|
|||
|
||||
/* Try a persistent hostname first */
|
||||
configured_hostname = nm_hostname_manager_get_static_hostname(priv->hostname_manager);
|
||||
if (configured_hostname && nm_utils_is_specific_hostname(configured_hostname)) {
|
||||
if (configured_hostname && nm_utils_is_not_empty_hostname(configured_hostname)) {
|
||||
_set_hostname(self, configured_hostname, "from system configuration", FALSE);
|
||||
priv->dhcp_hostname = FALSE;
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue