Commit 3973f8eb authored by Thomas Haller's avatar Thomas Haller

active-connection: use activation-type for active connection instead of assumed flag

parent 8a31e66d
......@@ -49,7 +49,6 @@ typedef struct _NMActiveConnectionPrivate {
bool is_default6:1;
bool state_set:1;
bool vpn:1;
bool assumed:1;
bool master_ready:1;
NMActivationType activation_type:3;
......@@ -568,7 +567,7 @@ nm_active_connection_set_device (NMActiveConnection *self, NMDevice *device)
g_signal_connect (device, "notify::" NM_DEVICE_METERED,
G_CALLBACK (device_metered_changed), self);
if (!priv->assumed) {
if (priv->activation_type == NM_ACTIVATION_TYPE_MANAGED) {
priv->pending_activation_id = g_strdup_printf (NM_PENDING_ACTIONPREFIX_ACTIVATION"%p", (void *)self);
nm_device_add_pending_action (device, priv->pending_activation_id, TRUE);
}
......@@ -722,24 +721,10 @@ nm_active_connection_get_activation_type (NMActiveConnection *self)
return NM_ACTIVE_CONNECTION_GET_PRIVATE (self)->activation_type;
}
void
nm_active_connection_set_assumed (NMActiveConnection *self, gboolean assumed)
{
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (self);
g_return_if_fail (priv->assumed == FALSE);
priv->assumed = assumed;
if (priv->pending_activation_id) {
nm_device_remove_pending_action (priv->device, priv->pending_activation_id, TRUE);
g_clear_pointer (&priv->pending_activation_id, g_free);
}
}
gboolean
nm_active_connection_get_assumed (NMActiveConnection *self)
{
return NM_ACTIVE_CONNECTION_GET_PRIVATE (self)->assumed;
return nm_active_connection_get_activation_type (self) == NM_ACTIVATION_TYPE_ASSUME;
}
/*****************************************************************************/
......
......@@ -159,9 +159,6 @@ void nm_active_connection_set_master (NMActiveConnection *self,
void nm_active_connection_set_parent (NMActiveConnection *self,
NMActiveConnection *parent);
void nm_active_connection_set_assumed (NMActiveConnection *self,
gboolean assumed);
gboolean nm_active_connection_get_assumed (NMActiveConnection *self);
NMActivationType nm_active_connection_get_activation_type (NMActiveConnection *self);
......
......@@ -1837,7 +1837,7 @@ assume_connection (NMManager *self, NMDevice *device, NMSettingsConnection *conn
subject = nm_auth_subject_new_internal ();
active = _new_active_connection (self, NM_CONNECTION (connection), NULL, NULL,
device, subject, NM_ACTIVATION_TYPE_MANAGED, &error);
device, subject, NM_ACTIVATION_TYPE_ASSUME, &error);
g_object_unref (subject);
if (!active) {
......@@ -1853,7 +1853,6 @@ assume_connection (NMManager *self, NMDevice *device, NMSettingsConnection *conn
if (find_master (self, NM_CONNECTION (connection), device, NULL, NULL, &master_ac, NULL) && master_ac)
nm_active_connection_set_master (active, master_ac);
nm_active_connection_set_assumed (active, TRUE);
nm_exported_object_export (NM_EXPORTED_OBJECT (active));
active_connection_add (self, active);
nm_device_queue_activation (device, NM_ACT_REQUEST (active));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment