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:
@@ -271,8 +271,7 @@ no-auto-default=*
|
|||||||
Set the management mode of the hostname. This parameter will
|
Set the management mode of the hostname. This parameter will
|
||||||
affect only the transient hostname. If a valid static hostname is set,
|
affect only the transient hostname. If a valid static hostname is set,
|
||||||
NetworkManager will skip the update of the hostname despite the value of
|
NetworkManager will skip the update of the hostname despite the value of
|
||||||
this option. An hostname empty or equal to 'localhost', 'localhost6',
|
this option. A hostname empty or equal to '(none)' is considered invalid.
|
||||||
'localhost.localdomain' or 'localhost6.localdomain' is considered invalid.
|
|
||||||
</para>
|
</para>
|
||||||
<para><literal>default</literal>: NetworkManager will update the
|
<para><literal>default</literal>: NetworkManager will update the
|
||||||
hostname with the one provided via DHCP or reverse DNS lookup of 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 */
|
/* Try a persistent hostname first */
|
||||||
configured_hostname = nm_hostname_manager_get_static_hostname(priv->hostname_manager);
|
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);
|
_set_hostname(self, configured_hostname, "from system configuration", FALSE);
|
||||||
priv->dhcp_hostname = FALSE;
|
priv->dhcp_hostname = FALSE;
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user