mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-08 00:10:15 +01:00
ifcfg-rh: ignore explicitly set 'localhost' hostnames (rh #441453)
To match 'network' service behavior, which would perform reverse address lookups when the HOSTNAME from /etc/sysconfig/network was 'localhost' or 'localhost.localdomain'. Just name your machine already.
This commit is contained in:
parent
0393d4fa56
commit
3feb016594
1 changed files with 9 additions and 0 deletions
|
|
@ -499,6 +499,15 @@ plugin_get_hostname (SCPluginIfcfg *plugin)
|
|||
|
||||
hostname = svGetValue (network, "HOSTNAME");
|
||||
svCloseFile (network);
|
||||
|
||||
/* Ignore a hostname of 'localhost' or 'localhost.localdomain' to preserve
|
||||
* 'network' service behavior.
|
||||
*/
|
||||
if (hostname && (!strcmp (hostname, "localhost") || !strcmp (hostname, "localhost.localdomain"))) {
|
||||
g_free (hostname);
|
||||
hostname = NULL;
|
||||
}
|
||||
|
||||
return hostname;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue