From 3feb016594d0248263c858ceb1e6e378e2176c40 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 19 Feb 2009 15:49:37 -0500 Subject: [PATCH] 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. --- system-settings/plugins/ifcfg-rh/plugin.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index e4f5bcfd7..b673615ad 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -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; }