summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-03-08 08:26:48 +0100
committerThomas Haller <thaller@redhat.com>2017-03-16 18:27:33 +0100
commit3973f8ebcd8f439eee6cb816d5bd6742e8ac5a85 (patch)
treee68ff08d7dd08ba6c3a51ee7f7e742a54a166890
parent8a31e66d2cffbedb2efa39d7e6d38d1dfe51cb61 (diff)
downloadNetworkManager-3973f8ebcd8f439eee6cb816d5bd6742e8ac5a85.tar.gz
active-connection: use activation-type for active connection instead of assumed flag
-rw-r--r--src/nm-active-connection.c19
-rw-r--r--src/nm-active-connection.h3
-rw-r--r--src/nm-manager.c3
3 files changed, 3 insertions, 22 deletions
diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c
index 95b81b1d8d..60e87fc313 100644
--- a/src/nm-active-connection.c
+++ b/src/nm-active-connection.c
@@ -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;
}
/*****************************************************************************/
diff --git a/src/nm-active-connection.h b/src/nm-active-connection.h
index 0c2e2358d5..d99a959e90 100644
--- a/src/nm-active-connection.h
+++ b/src/nm-active-connection.h
@@ -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);
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 4218530870..1995ccce6a 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -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));