Blob Blame History Raw
diff -up NetworkManager-0.7.0.99/system-settings/plugins/ifcfg-rh/reader.c.foo NetworkManager-0.7.0.99/system-settings/plugins/ifcfg-rh/reader.c
--- NetworkManager-0.7.0.99/system-settings/plugins/ifcfg-rh/reader.c.foo	2009-03-18 13:43:30.000000000 -0400
+++ NetworkManager-0.7.0.99/system-settings/plugins/ifcfg-rh/reader.c	2009-03-18 13:49:34.000000000 -0400
@@ -197,7 +197,7 @@ get_one_ip4_addr (shvarFile *ifcfg,
 }
 
 static NMSetting *
-make_ip4_setting (shvarFile *ifcfg, const char *network_file, GError **error)
+make_ip4_setting (shvarFile *ifcfg, const char *network_file, gboolean *minimal, GError **error)
 {
 	NMSettingIP4Config *s_ip4 = NULL;
 	char *value = NULL;
@@ -253,8 +253,13 @@ make_ip4_setting (shvarFile *ifcfg, cons
 		tmp_ip4 = svGetValue (ifcfg, "IPADDR", FALSE);
 		tmp_prefix = svGetValue (ifcfg, "PREFIX", FALSE);
 		tmp_netmask = svGetValue (ifcfg, "NETMASK", FALSE);
-		if (!tmp_ip4 && !tmp_prefix && !tmp_netmask)
+		if (!tmp_ip4 && !tmp_prefix && !tmp_netmask) {
 			method = NM_SETTING_IP4_CONFIG_METHOD_AUTO;
+			value = svGetValue (ifcfg, "ONBOOT", FALSE);
+			if (value && !svTrueValue (ifcfg, "ONBOOT", TRUE))
+				*minimal = TRUE;
+			g_free (value);
+		}
 		g_free (tmp_ip4);
 		g_free (tmp_prefix);
 		g_free (tmp_netmask);
@@ -1247,6 +1252,8 @@ connection_from_file (const char *filena
 	char *nmc = NULL;
 	NMSetting *s_ip4;
 	char *ifcfg_name = NULL;
+	gboolean minimal = FALSE;
+	NMSettingConnection *s_con;
 
 	g_return_val_if_fail (filename != NULL, NULL);
 	g_return_val_if_fail (ignored != NULL, NULL);
@@ -1345,7 +1351,7 @@ connection_from_file (const char *filena
 	if (!connection || *ignored)
 		goto done;
 
-	s_ip4 = make_ip4_setting (parsed, network_file, error);
+	s_ip4 = make_ip4_setting (parsed, network_file, &minimal, error);
 	if (*error) {
 		g_object_unref (connection);
 		connection = NULL;
@@ -1354,6 +1360,10 @@ connection_from_file (const char *filena
 		nm_connection_add_setting (connection, s_ip4);
 	}
 
+	s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION);
+	if (s_con && minimal)
+		g_object_set (s_con, NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, NULL);
+
 	if (!nm_connection_verify (connection, error)) {
 		g_object_unref (connection);
 		connection = NULL;