device: set device's sys-iface-state only shortly before activating device

During _new_active_connection() we just create the NMActiveConnection
instance to proceed with authorization. The caller might not even
authorize, so we must not touch the device yet.

Do that only later.
This commit is contained in:
Thomas Haller 2018-04-17 07:31:13 +02:00
parent 9fe4239f33
commit c3fb02641a

View file

@ -3806,6 +3806,9 @@ _internal_activate_device (NMManager *self, NMActiveConnection *active, GError *
return FALSE;
}
if (nm_active_connection_get_activation_type (active) == NM_ACTIVATION_TYPE_MANAGED)
nm_device_sys_iface_state_set (device, NM_DEVICE_SYS_IFACE_STATE_MANAGED);
/* Create any backing resources the device needs */
if (!nm_device_is_real (device)) {
NMDevice *parent;
@ -4065,9 +4068,6 @@ _new_active_connection (NMManager *self,
subject);
}
if (activation_type == NM_ACTIVATION_TYPE_MANAGED)
nm_device_sys_iface_state_set (device, NM_DEVICE_SYS_IFACE_STATE_MANAGED);
return (NMActiveConnection *) nm_act_request_new (settings_connection,
applied,
specific_object,