summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2013-09-03 14:54:24 -0500
committerDan Williams <dcbw@redhat.com>2013-10-31 15:33:58 -0500
commit4ec5f5c8e3025b5221737624ddc06d6bc7f6d00d (patch)
tree2c1a07e04a35fc3aa7ac29a137132c884bb54a7e
parent35124dbb1432693d650d835dde95d2d4a6e0b65f (diff)
downloadNetworkManager-4ec5f5c8e3025b5221737624ddc06d6bc7f6d00d.tar.gz
libnm-glib: add support for NULL connections to nm_client_activate_connection()
Pass along to NetworkManager, which picks the best available connection for the device and activates it.
-rw-r--r--libnm-glib/nm-client.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c
index c424037bc0..1ffb8668f7 100644
--- a/libnm-glib/nm-client.c
+++ b/libnm-glib/nm-client.c
@@ -594,7 +594,7 @@ activate_nm_not_running (gpointer user_data)
/**
* nm_client_activate_connection:
* @client: a #NMClient
- * @connection: an #NMConnection
+ * @connection: (allow-none): an #NMConnection
* @device: (allow-none): the #NMDevice
* @specific_object: (allow-none): the object path of a connection-type-specific
* object this activation should use. This parameter is currently ignored for
@@ -613,6 +613,9 @@ activate_nm_not_running (gpointer user_data)
* #NMWimaxNsp for WiMAX connections, to which you wish to connect. If the
* specific object is not given, NetworkManager can, in some cases, automatically
* determine which network to connect to given the settings in @connection.
+ *
+ * If @connection is not given for a device-based activation, NetworkManager
+ * picks the best available connection for the device and activates it.
**/
void
nm_client_activate_connection (NMClient *client,
@@ -628,7 +631,8 @@ nm_client_activate_connection (NMClient *client,
g_return_if_fail (NM_IS_CLIENT (client));
if (device)
g_return_if_fail (NM_IS_DEVICE (device));
- g_return_if_fail (NM_IS_CONNECTION (connection));
+ if (connection)
+ g_return_if_fail (NM_IS_CONNECTION (connection));
info = g_slice_new0 (ActivateInfo);
info->act_fn = callback;
@@ -645,7 +649,7 @@ nm_client_activate_connection (NMClient *client,
dbus_g_proxy_begin_call (priv->client_proxy, "ActivateConnection",
activate_cb, info, NULL,
- DBUS_TYPE_G_OBJECT_PATH, nm_connection_get_path (connection),
+ DBUS_TYPE_G_OBJECT_PATH, connection ? nm_connection_get_path (connection) : "/",
DBUS_TYPE_G_OBJECT_PATH, device ? nm_object_get_path (NM_OBJECT (device)) : "/",
DBUS_TYPE_G_OBJECT_PATH, specific_object ? specific_object : "/",
G_TYPE_INVALID);