ifupdown: Correctly mark unmanaged devices (debian #569215)

If we find a "iface ..." line, add the interface to
well_known_interfaces no matter if there is a connection for it or not.

Otherwise we fail to mark devices as unmageded in cases like

iface wlan0 inet manual
	wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

as NM does not know how to parse such a interface configuration.

Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=569215
This commit is contained in:
Michael Biebl
2010-12-09 00:13:37 -06:00
committed by Dan Williams
parent a752140c8f
commit 1939209759

View File

@@ -368,6 +368,7 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config)
/* Remove any connection for this block that was previously found */ /* Remove any connection for this block that was previously found */
exported = g_hash_table_lookup (priv->iface_connections, block->name); exported = g_hash_table_lookup (priv->iface_connections, block->name);
if (exported) { if (exported) {
PLUGIN_PRINT("SCPlugin-Ifupdown", "deleting %s from iface_connections", block->name);
nm_settings_connection_interface_delete (NM_SETTINGS_CONNECTION_INTERFACE (exported), nm_settings_connection_interface_delete (NM_SETTINGS_CONNECTION_INTERFACE (exported),
ignore_cb, ignore_cb,
NULL); NULL);
@@ -377,11 +378,14 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config)
/* add the new connection */ /* add the new connection */
exported = nm_ifupdown_connection_new (block); exported = nm_ifupdown_connection_new (block);
if (exported) { if (exported) {
PLUGIN_PRINT("SCPlugin-Ifupdown", "adding %s to iface_connections", block->name);
g_hash_table_insert (priv->iface_connections, block->name, exported); g_hash_table_insert (priv->iface_connections, block->name, exported);
g_hash_table_insert (priv->well_known_interfaces, block->name, "known");
} }
PLUGIN_PRINT("SCPlugin-Ifupdown", "adding iface %s to well_known_interfaces", block->name);
g_hash_table_insert (priv->well_known_interfaces, block->name, "known");
} else if (!strcmp ("mapping", block->type)) { } else if (!strcmp ("mapping", block->type)) {
g_hash_table_insert (priv->well_known_interfaces, block->name, "known"); g_hash_table_insert (priv->well_known_interfaces, block->name, "known");
PLUGIN_PRINT("SCPlugin-Ifupdown", "adding mapping %s to well_known_interfaces", block->name);
} }
block = block->next; block = block->next;
} }