wifi/ap: set the current-ap after adding the new AP

First add the new AP, before setting it as current.

Also set the AP *after* thawing the notifications. Otherwise
it is not clear which notification gets raised first as their
order is undefined. But we want that the client first sees
the new AP and later gets a notification about having a new
current.
This commit is contained in:
Thomas Haller 2015-11-07 10:00:06 +01:00
parent 8a8ecc46ca
commit 0c1e290c97

View file

@ -2346,9 +2346,9 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason)
ap_path = nm_exported_object_export (NM_EXPORTED_OBJECT (ap));
g_hash_table_insert (priv->aps, (gpointer) ap_path, ap);
g_object_freeze_notify (G_OBJECT (self));
set_current_ap (self, ap, FALSE, FALSE);
emit_ap_added_removed (self, ACCESS_POINT_ADDED, ap, TRUE);
g_object_thaw_notify (G_OBJECT (self));
set_current_ap (self, ap, FALSE, FALSE);
nm_active_connection_set_specific_object (NM_ACTIVE_CONNECTION (req), ap_path);
return NM_ACT_STAGE_RETURN_SUCCESS;