core: remove assume from nm-activation-request

Whether an active connection is assumed or connected from scratch is
only important during nm_device_activate(). When the activation process
is set up, there's no difference from any other active connection.

Acked-by: Dan Winship <danw@gnome.org>
Acked-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Pavel Šimerda
2013-06-26 00:39:46 +02:00
parent 34d28376ed
commit 5affa446aa
6 changed files with 2 additions and 33 deletions

View File

@@ -3457,8 +3457,6 @@ nm_device_activate_schedule_stage3_ip_config_start (NMDevice *self)
g_return_if_fail (priv->act_request);
state = nm_device_get_state (self);
if (nm_active_connection_get_assumed (NM_ACTIVE_CONNECTION (priv->act_request)) == FALSE)
g_warn_if_fail (state >= NM_DEVICE_STATE_PREPARE && state <= NM_DEVICE_STATE_NEED_AUTH);
/* Add the interface to the specified firewall zone */
connection = nm_device_get_connection (self);
@@ -4261,12 +4259,12 @@ nm_device_activate (NMDevice *self, NMActRequest *req)
priv->act_request = g_object_ref (req);
g_object_notify (G_OBJECT (self), NM_DEVICE_ACTIVE_CONNECTION);
if (nm_active_connection_get_assumed (NM_ACTIVE_CONNECTION (req))) {
if (priv->state_reason == NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED) {
/* If it's an assumed connection, let the device subclass short-circuit
* the normal connection process and just copy its IP configs from the
* interface.
*/
nm_device_state_changed (self, NM_DEVICE_STATE_IP_CONFIG, NM_DEVICE_STATE_REASON_NONE);
nm_device_state_changed (self, NM_DEVICE_STATE_IP_CONFIG, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
nm_device_activate_schedule_stage3_ip_config_start (self);
} else {
NMDevice *master;

View File

@@ -356,8 +356,6 @@ device_state_changed (NMDevice *device, GParamSpec *pspec, NMActRequest *self)
* @user_uid: if @user_requested is %TRUE, the Unix UID of the user that requested
* @dbus_sender: if @user_requested is %TRUE, the D-BUS sender that requested
* the activation
* @assumed: pass %TRUE if the activation should "assume" (ie, taking over) an
* existing connection made before this instance of NM started
* @device: the device/interface to configure according to @connection
* @master: if the activation depends on another device (ie, bond or bridge
* or team master to which this device will be enslaved) pass the #NMDevice
@@ -373,7 +371,6 @@ nm_act_request_new (NMConnection *connection,
gboolean user_requested,
gulong user_uid,
const char *dbus_sender,
gboolean assumed,
NMDevice *device,
NMDevice *master)
{
@@ -388,7 +385,6 @@ nm_act_request_new (NMConnection *connection,
NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, specific_object,
NM_ACTIVE_CONNECTION_INT_USER_REQUESTED, user_requested,
NM_ACTIVE_CONNECTION_INT_USER_UID, user_uid,
NM_ACTIVE_CONNECTION_INT_ASSUMED, assumed,
NM_ACTIVE_CONNECTION_INT_MASTER, master,
NULL);
if (object) {

View File

@@ -51,7 +51,6 @@ NMActRequest *nm_act_request_new (NMConnection *connection,
gboolean user_requested,
gulong user_uid,
const char *dbus_sender,
gboolean assumed,
NMDevice *device,
NMDevice *master);

View File

@@ -50,7 +50,6 @@ typedef struct {
gboolean user_requested;
gulong user_uid;
gboolean assumed;
NMDevice *master;
} NMActiveConnectionPrivate;
@@ -70,7 +69,6 @@ enum {
PROP_INT_DEVICE,
PROP_INT_USER_REQUESTED,
PROP_INT_USER_UID,
PROP_INT_ASSUMED,
PROP_INT_MASTER,
LAST_PROP
@@ -227,14 +225,6 @@ nm_active_connection_get_user_uid (NMActiveConnection *self)
return NM_ACTIVE_CONNECTION_GET_PRIVATE (self)->user_uid;
}
gboolean
nm_active_connection_get_assumed (NMActiveConnection *self)
{
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (self), FALSE);
return NM_ACTIVE_CONNECTION_GET_PRIVATE (self)->assumed;
}
NMDevice *
nm_active_connection_get_device (NMActiveConnection *self)
{
@@ -281,9 +271,6 @@ set_property (GObject *object, guint prop_id,
case PROP_INT_USER_UID:
priv->user_uid = g_value_get_ulong (value);
break;
case PROP_INT_ASSUMED:
priv->assumed = g_value_get_boolean (value);
break;
case PROP_INT_MASTER:
g_warn_if_fail (priv->master == NULL);
priv->master = g_value_dup_object (value);
@@ -478,13 +465,6 @@ nm_active_connection_class_init (NMActiveConnectionClass *ac_class)
0, G_MAXULONG, 0,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_INT_ASSUMED,
g_param_spec_boolean (NM_ACTIVE_CONNECTION_INT_ASSUMED,
"Assumed",
"Assumed",
FALSE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_INT_MASTER,
g_param_spec_object (NM_ACTIVE_CONNECTION_INT_MASTER,
"Internal master device",

View File

@@ -48,7 +48,6 @@
#define NM_ACTIVE_CONNECTION_INT_DEVICE "int-device"
#define NM_ACTIVE_CONNECTION_INT_USER_REQUESTED "int-user-requested"
#define NM_ACTIVE_CONNECTION_INT_USER_UID "int-user-uid"
#define NM_ACTIVE_CONNECTION_INT_ASSUMED "int-assumed"
#define NM_ACTIVE_CONNECTION_INT_MASTER "int-master"
@@ -96,8 +95,6 @@ gboolean nm_active_connection_get_user_requested (NMActiveConnection *self)
gulong nm_active_connection_get_user_uid (NMActiveConnection *self);
gboolean nm_active_connection_get_assumed (NMActiveConnection *self);
NMDevice * nm_active_connection_get_master (NMActiveConnection *self);
#endif /* NM_ACTIVE_CONNECTION_H */

View File

@@ -2575,7 +2575,6 @@ internal_activate_device (NMManager *manager,
user_requested,
sender_uid,
dbus_sender,
assumed,
device,
master_device);
g_assert (req);