mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 19:10:17 +01:00
2007-10-16 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-client.c - (nm_client_activate_device): convert NULL specific_object to "/", which is used in place of NULL * src/nm-manager.c - (impl_manager_activate_device): convert "/" specific_object back into NULL git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2979 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
850f441ea5
commit
bebd0e38b8
3 changed files with 26 additions and 2 deletions
10
ChangeLog
10
ChangeLog
|
|
@ -1,3 +1,13 @@
|
|||
2007-10-16 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* libnm-util/nm-client.c
|
||||
- (nm_client_activate_device): convert NULL specific_object to "/",
|
||||
which is used in place of NULL
|
||||
|
||||
* src/nm-manager.c
|
||||
- (impl_manager_activate_device): convert "/" specific_object back into
|
||||
NULL
|
||||
|
||||
2007-10-16 Tambet Ingo <tambet@gmail.com>
|
||||
|
||||
Implement a generic NMSetting creator from setting name.
|
||||
|
|
|
|||
|
|
@ -518,12 +518,19 @@ nm_client_activate_device (NMClient *client,
|
|||
gpointer user_data)
|
||||
{
|
||||
ActivateDeviceInfo *info;
|
||||
char *internal_so = (char *) specific_object;
|
||||
|
||||
g_return_if_fail (NM_IS_CLIENT (client));
|
||||
g_return_if_fail (NM_IS_DEVICE (device));
|
||||
g_return_if_fail (service_name != NULL);
|
||||
g_return_if_fail (connection_path != NULL);
|
||||
|
||||
/* NULL specific object must be translated into "/" because D-Bus does
|
||||
* not have any idea of NULL object paths.
|
||||
*/
|
||||
if (internal_so == NULL)
|
||||
internal_so = "/";
|
||||
|
||||
info = g_slice_new (ActivateDeviceInfo);
|
||||
info->fn = callback;
|
||||
info->user_data = user_data;
|
||||
|
|
|
|||
|
|
@ -1229,6 +1229,7 @@ impl_manager_activate_device (NMManager *manager,
|
|||
NMConnectionType connection_type;
|
||||
NMConnection *connection;
|
||||
GError *err = NULL;
|
||||
char *real_sop = NULL;
|
||||
|
||||
device = nm_manager_get_device_by_path (manager, device_path);
|
||||
if (!device) {
|
||||
|
|
@ -1247,12 +1248,16 @@ impl_manager_activate_device (NMManager *manager,
|
|||
goto err;
|
||||
}
|
||||
|
||||
/* "/" is special-cased to NULL to get through D-Bus */
|
||||
if (specific_object_path && strcmp (specific_object_path, "/"))
|
||||
real_sop = g_strdup (specific_object_path);
|
||||
|
||||
connection = nm_manager_get_connection_by_object_path (manager, connection_type, connection_path);
|
||||
if (connection) {
|
||||
// FIXME: remove old_dev deactivation when multiple device support lands
|
||||
deactivate_old_device (manager);
|
||||
|
||||
if (nm_manager_activate_device (manager, device, connection, specific_object_path, TRUE)) {
|
||||
if (nm_manager_activate_device (manager, device, connection, real_sop, TRUE)) {
|
||||
dbus_g_method_return (context, TRUE);
|
||||
} else {
|
||||
err = nm_manager_error_new ("Error in device activation");
|
||||
|
|
@ -1276,7 +1281,7 @@ impl_manager_activate_device (NMManager *manager,
|
|||
info->device = g_object_ref (device);
|
||||
info->connection_type = connection_type;
|
||||
info->connection_path = g_strdup (connection_path);
|
||||
info->specific_object_path = g_strdup (specific_object_path);
|
||||
info->specific_object_path = g_strdup (real_sop);
|
||||
info->timeout_id = g_timeout_add (5000, wait_for_connection_expired, manager);
|
||||
|
||||
// FIXME: should probably be per-device, not global to the manager
|
||||
|
|
@ -1288,6 +1293,8 @@ impl_manager_activate_device (NMManager *manager,
|
|||
dbus_g_method_return_error (context, err);
|
||||
g_error_free (err);
|
||||
}
|
||||
|
||||
g_free (real_sop);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue