summaryrefslogtreecommitdiff
path: root/src/settings/plugins/ifcfg-rh/reader.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2013-09-26 17:34:23 -0400
committerDan Winship <danw@gnome.org>2013-10-11 12:24:34 -0400
commit68f12b4e9c134d41e42cc8a1986cad6bb3c07b7a (patch)
treede39f242269a9e2b0bf5edfbb75bb61092639928 /src/settings/plugins/ifcfg-rh/reader.c
parent5bcdfd39853f5953a956fc88cc5a550f68f3153f (diff)
downloadNetworkManager-68f12b4e9c134d41e42cc8a1986cad6bb3c07b7a.tar.gz
settings: make connections always have s_ip4 and s_ip6
Make sure that all connections returned from NMSettings or created via AddAndActivateConnection have an NMSettingIP4Config and an NMSettingIP6Config, with non-NULL methods, and get rid of now-unnecessary checks for those. Also move the slaves-can't-have-IP-config checks into the platform-independent code as well. This also gets rid of spurious "ignoring IP4/IP6 configuration" warnings in ifcfg-rh when reading a slave ifcfg file. Partly based on a patch from Pavel. https://bugzilla.gnome.org/show_bug.cgi?id=708875
Diffstat (limited to 'src/settings/plugins/ifcfg-rh/reader.c')
-rw-r--r--src/settings/plugins/ifcfg-rh/reader.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c
index f9dd034037..4831247aea 100644
--- a/src/settings/plugins/ifcfg-rh/reader.c
+++ b/src/settings/plugins/ifcfg-rh/reader.c
@@ -52,6 +52,7 @@
#include "wifi-utils.h"
#include "nm-posix-signals.h"
+#include "NetworkManagerUtils.h"
#include "common.h"
#include "shvar.h"
@@ -4646,10 +4647,6 @@ connection_from_file (const char *filename,
g_object_unref (connection);
connection = NULL;
goto done;
- } else if (utils_ignore_ip_config (connection)) {
- PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: ignoring IP6 configuration");
- g_object_unref (s_ip6);
- s_ip6 = NULL;
} else {
const char *method;
@@ -4664,11 +4661,7 @@ connection_from_file (const char *filename,
g_object_unref (connection);
connection = NULL;
goto done;
- } else if (s_ip4 && utils_ignore_ip_config (connection)) {
- PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: ignoring IP4 configuration");
- g_object_unref (s_ip4);
- s_ip4 = NULL;
- } else if (s_ip4)
+ } else
nm_connection_add_setting (connection, s_ip4);
/* There is only one DOMAIN variable and it is read and put to IPv4 config
@@ -4703,6 +4696,8 @@ connection_from_file (const char *filename,
}
g_free (bootproto);
+ nm_utils_normalize_connection (connection, TRUE);
+
if (!nm_connection_verify (connection, error)) {
g_object_unref (connection);
connection = NULL;