summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/devices/bluetooth/nm-device-bt.c2
-rw-r--r--src/devices/nm-device-generic.c2
-rw-r--r--src/devices/nm-device-vlan.c10
-rw-r--r--src/devices/nm-device.c131
-rw-r--r--src/devices/nm-device.h45
-rw-r--r--src/devices/wwan/nm-device-modem.c2
-rw-r--r--src/nm-manager.c28
7 files changed, 113 insertions, 107 deletions
diff --git a/src/devices/bluetooth/nm-device-bt.c b/src/devices/bluetooth/nm-device-bt.c
index 9fcb33bc81..75b6a97d27 100644
--- a/src/devices/bluetooth/nm-device-bt.c
+++ b/src/devices/bluetooth/nm-device-bt.c
@@ -458,7 +458,7 @@ modem_prepare_result (NMModem *modem,
* the device to be auto-activated anymore, which would risk locking
* the SIM if the incorrect PIN continues to be used.
*/
- g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, FALSE, NULL);
+ nm_device_set_autoconnect (device, FALSE);
_LOGI (LOGD_MB, "disabling autoconnect due to failed SIM PIN");
}
diff --git a/src/devices/nm-device-generic.c b/src/devices/nm-device-generic.c
index 0be55d54f0..0689d71676 100644
--- a/src/devices/nm-device-generic.c
+++ b/src/devices/nm-device-generic.c
@@ -138,7 +138,7 @@ constructor (GType type,
n_construct_params,
construct_params);
- nm_device_set_unmanaged_initial (NM_DEVICE (object), NM_UNMANAGED_DEFAULT, TRUE);
+ nm_device_set_unmanaged_flags_initial (NM_DEVICE (object), NM_UNMANAGED_DEFAULT, TRUE);
return object;
}
diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c
index 734a483bdc..3cd7d9c6ac 100644
--- a/src/devices/nm-device-vlan.c
+++ b/src/devices/nm-device-vlan.c
@@ -77,7 +77,7 @@ parent_state_changed (NMDevice *parent,
if (reason == NM_DEVICE_STATE_REASON_CARRIER)
return;
- nm_device_set_unmanaged (NM_DEVICE (self), NM_UNMANAGED_PARENT, !nm_device_get_managed (parent), reason);
+ nm_device_set_unmanaged_flags (NM_DEVICE (self), NM_UNMANAGED_PARENT, !nm_device_get_managed (parent), reason);
}
static void
@@ -134,10 +134,10 @@ nm_device_vlan_set_parent (NMDeviceVlan *self, NMDevice *parent)
G_CALLBACK (parent_hwaddr_changed), device);
/* Set parent-dependent unmanaged flag */
- nm_device_set_unmanaged (device,
- NM_UNMANAGED_PARENT,
- !nm_device_get_managed (parent),
- NM_DEVICE_STATE_REASON_PARENT_MANAGED_CHANGED);
+ nm_device_set_unmanaged_flags (device,
+ NM_UNMANAGED_PARENT,
+ !nm_device_get_managed (parent),
+ NM_DEVICE_STATE_REASON_PARENT_MANAGED_CHANGED);
}
/* Recheck availability now that the parent has changed */
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 6cbf29065b..7f8821e0e3 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -1174,7 +1174,7 @@ nm_device_finish_init (NMDevice *self)
&& priv->ifindex > 0
&& ( !priv->up
|| !priv->platform_link_initialized))
- nm_device_set_unmanaged_initial (self, NM_UNMANAGED_EXTERNAL_DOWN, TRUE);
+ nm_device_set_unmanaged_flags_initial (self, NM_UNMANAGED_EXTERNAL_DOWN, TRUE);
if (priv->master)
nm_device_enslave_slave (priv->master, self, NULL);
@@ -1184,19 +1184,19 @@ nm_device_finish_init (NMDevice *self)
/* Unmanaged the loopback device with an explicit NM_UNMANAGED_LOOPBACK flag.
* Later we might want to manage 'lo' too. Currently that doesn't work because
* NetworkManager might down the interface or remove the 127.0.0.1 address. */
- nm_device_set_unmanaged_initial (self, NM_UNMANAGED_LOOPBACK, TRUE);
+ nm_device_set_unmanaged_flags_initial (self, NM_UNMANAGED_LOOPBACK, TRUE);
} else if (priv->platform_link_initialized || (priv->is_nm_owned && nm_device_is_software (self))) {
gboolean platform_unmanaged = FALSE;
if (nm_platform_link_get_unmanaged (NM_PLATFORM_GET, priv->ifindex, &platform_unmanaged))
- nm_device_set_unmanaged_initial (self, NM_UNMANAGED_DEFAULT, platform_unmanaged);
+ nm_device_set_unmanaged_flags_initial (self, NM_UNMANAGED_DEFAULT, platform_unmanaged);
} else {
/* Hardware and externally-created software links stay unmanaged
* until they are fully initialized by the platform. NM created
* links must be available for activation immediately and thus
* do not get the PLATFORM_INIT unmanaged flag set.
*/
- nm_device_set_unmanaged_initial (self, NM_UNMANAGED_PLATFORM_INIT, TRUE);
+ nm_device_set_unmanaged_flags_initial (self, NM_UNMANAGED_PLATFORM_INIT, TRUE);
}
}
@@ -1503,16 +1503,16 @@ device_link_changed (NMDevice *self)
priv->platform_link_initialized = TRUE;
if (nm_platform_link_get_unmanaged (NM_PLATFORM_GET, priv->ifindex, &platform_unmanaged)) {
- nm_device_set_unmanaged (self,
- NM_UNMANAGED_DEFAULT,
- platform_unmanaged,
- NM_DEVICE_STATE_REASON_USER_REQUESTED);
+ nm_device_set_unmanaged_flags (self,
+ NM_UNMANAGED_DEFAULT,
+ platform_unmanaged,
+ NM_DEVICE_STATE_REASON_USER_REQUESTED);
}
- nm_device_set_unmanaged (self,
- NM_UNMANAGED_PLATFORM_INIT,
- FALSE,
- NM_DEVICE_STATE_REASON_NOW_MANAGED);
+ nm_device_set_unmanaged_flags (self,
+ NM_UNMANAGED_PLATFORM_INIT,
+ FALSE,
+ NM_DEVICE_STATE_REASON_NOW_MANAGED);
emit_link_initialized = TRUE;
}
@@ -1526,7 +1526,7 @@ device_link_changed (NMDevice *self)
/* Manage externally-created software interfaces only when they are IFF_UP */
g_assert (priv->ifindex > 0);
if (NM_DEVICE_GET_CLASS (self)->can_unmanaged_external_down (self)) {
- gboolean external_down = nm_device_get_unmanaged (self, NM_UNMANAGED_EXTERNAL_DOWN);
+ gboolean external_down = !!nm_device_get_unmanaged_flags (self, NM_UNMANAGED_EXTERNAL_DOWN);
if (external_down && NM_FLAGS_HAS (info.flags, IFF_UP)) {
if (nm_device_get_state (self) < NM_DEVICE_STATE_DISCONNECTED) {
@@ -1540,10 +1540,10 @@ device_link_changed (NMDevice *self)
* the device before assumption occurs, pass
* NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED as the reason.
*/
- nm_device_set_unmanaged (self,
- NM_UNMANAGED_EXTERNAL_DOWN,
- FALSE,
- NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
+ nm_device_set_unmanaged_flags (self,
+ NM_UNMANAGED_EXTERNAL_DOWN,
+ FALSE,
+ NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
} else {
/* Don't trigger a state change; if the device is in a
* state higher than UNAVAILABLE, it is already IFF_UP
@@ -1555,10 +1555,10 @@ device_link_changed (NMDevice *self)
/* If the device is already disconnected and is set !IFF_UP,
* unmanage it.
*/
- nm_device_set_unmanaged (self,
- NM_UNMANAGED_EXTERNAL_DOWN,
- TRUE,
- NM_DEVICE_STATE_REASON_USER_REQUESTED);
+ nm_device_set_unmanaged_flags (self,
+ NM_UNMANAGED_EXTERNAL_DOWN,
+ TRUE,
+ NM_DEVICE_STATE_REASON_USER_REQUESTED);
}
}
}
@@ -2524,7 +2524,7 @@ nm_device_get_autoconnect (NMDevice *self)
return NM_DEVICE_GET_PRIVATE (self)->autoconnect;
}
-static void
+void
nm_device_set_autoconnect (NMDevice *self, gboolean autoconnect)
{
NMDevicePrivate *priv;
@@ -8258,15 +8258,16 @@ nm_device_get_managed (NMDevice *self)
}
/**
- * nm_device_get_unmanaged():
+ * nm_device_get_unmanaged_flags():
* @self: the #NMDevice
+ * @flag: return only the selected flags
*
- * Returns: %TRUE if the device is unmanaged for @flag.
+ * Returns: the unmanage flags of the device (filtered with @flag)
*/
-gboolean
-nm_device_get_unmanaged (NMDevice *self, NMUnmanagedFlags flag)
+NMUnmanagedFlags
+nm_device_get_unmanaged_flags (NMDevice *self, NMUnmanagedFlags flag)
{
- return NM_FLAGS_ANY (NM_DEVICE_GET_PRIVATE (self)->unmanaged_flags, flag);
+ return NM_DEVICE_GET_PRIVATE (self)->unmanaged_flags & flag;
}
/**
@@ -8278,7 +8279,7 @@ nm_device_get_unmanaged (NMDevice *self, NMUnmanagedFlags flag)
static gboolean
nm_device_get_default_unmanaged (NMDevice *self)
{
- return nm_device_get_unmanaged (self, NM_UNMANAGED_DEFAULT);
+ return !!nm_device_get_unmanaged_flags (self, NM_UNMANAGED_DEFAULT);
}
static void
@@ -8310,10 +8311,10 @@ _set_unmanaged_flags (NMDevice *self,
}
void
-nm_device_set_unmanaged (NMDevice *self,
- NMUnmanagedFlags flag,
- gboolean unmanaged,
- NMDeviceStateReason reason)
+nm_device_set_unmanaged_flags (NMDevice *self,
+ NMUnmanagedFlags flag,
+ gboolean unmanaged,
+ NMDeviceStateReason reason)
{
NMDevicePrivate *priv;
gboolean was_managed, now_managed;
@@ -8340,7 +8341,7 @@ nm_device_set_unmanaged (NMDevice *self,
}
void
-nm_device_set_unmanaged_by_device_spec (NMDevice *self, const GSList *unmanaged_specs)
+nm_device_set_unmanaged_flags_by_device_spec (NMDevice *self, const GSList *unmanaged_specs)
{
NMDevicePrivate *priv;
gboolean unmanaged;
@@ -8353,43 +8354,28 @@ nm_device_set_unmanaged_by_device_spec (NMDevice *self, const GSList *unmanaged_
return;
unmanaged = nm_device_spec_match_list (self, unmanaged_specs);
- nm_device_set_unmanaged (self,
- NM_UNMANAGED_USER,
- unmanaged,
- unmanaged
- ? NM_DEVICE_STATE_REASON_NOW_UNMANAGED
- : NM_DEVICE_STATE_REASON_NOW_MANAGED);
-}
-
-void
-nm_device_set_unmanaged_quitting (NMDevice *self)
-{
- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
-
- /* It's OK to block here because we're quitting */
- if (nm_device_is_activating (self) || priv->state == NM_DEVICE_STATE_ACTIVATED)
- _set_state_full (self, NM_DEVICE_STATE_DEACTIVATING, NM_DEVICE_STATE_REASON_NOW_UNMANAGED, TRUE);
-
- nm_device_set_unmanaged (self,
- NM_UNMANAGED_INTERNAL,
- TRUE,
- NM_DEVICE_STATE_REASON_NOW_UNMANAGED);
+ nm_device_set_unmanaged_flags (self,
+ NM_UNMANAGED_USER,
+ unmanaged,
+ unmanaged
+ ? NM_DEVICE_STATE_REASON_NOW_UNMANAGED
+ : NM_DEVICE_STATE_REASON_NOW_MANAGED);
}
/**
- * nm_device_set_unmanaged_initial():
+ * nm_device_set_unmanaged_flags_initial():
* @self: the #NMDevice
* @flag: an #NMUnmanagedFlag
* @unmanaged: %TRUE or %FALSE to set or clear @flag
*
- * Like nm_device_set_unmanaged(), but must be set before the device is
+ * Like nm_device_set_unmanaged_flags(), but must be set before the device is
* initialized by nm_device_finish_init(), and does not trigger state changes.
* Should only be used when initializing a device.
*/
void
-nm_device_set_unmanaged_initial (NMDevice *self,
- NMUnmanagedFlags flag,
- gboolean unmanaged)
+nm_device_set_unmanaged_flags_initial (NMDevice *self,
+ NMUnmanagedFlags flag,
+ gboolean unmanaged)
{
NMDevicePrivate *priv;
@@ -8403,6 +8389,23 @@ nm_device_set_unmanaged_initial (NMDevice *self,
}
void
+nm_device_set_unmanaged_quitting (NMDevice *self)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+
+ /* It's OK to block here because we're quitting */
+ if (nm_device_is_activating (self) || priv->state == NM_DEVICE_STATE_ACTIVATED)
+ _set_state_full (self, NM_DEVICE_STATE_DEACTIVATING, NM_DEVICE_STATE_REASON_NOW_UNMANAGED, TRUE);
+
+ nm_device_set_unmanaged_flags (self,
+ NM_UNMANAGED_INTERNAL,
+ TRUE,
+ NM_DEVICE_STATE_REASON_NOW_UNMANAGED);
+}
+
+/*****************************************************************************/
+
+void
nm_device_set_dhcp_timeout (NMDevice *self, guint32 timeout)
{
g_return_if_fail (NM_IS_DEVICE (self));
@@ -8566,7 +8569,7 @@ _nm_device_check_connection_available (NMDevice *self,
if (state < NM_DEVICE_STATE_UNMANAGED)
return FALSE;
if ( state < NM_DEVICE_STATE_UNAVAILABLE
- && nm_device_get_unmanaged (self, NM_UNMANAGED_ALL & ~NM_UNMANAGED_DEFAULT))
+ && nm_device_get_unmanaged_flags (self, NM_UNMANAGED_ALL & ~NM_UNMANAGED_DEFAULT))
return FALSE;
if ( state < NM_DEVICE_STATE_DISCONNECTED
&& !nm_device_is_software (self)
@@ -10212,10 +10215,10 @@ set_property (GObject *object, guint prop_id,
case PROP_MANAGED:
val_bool = g_value_get_boolean (value);
priv->managed_touched_by_user = TRUE;
- nm_device_set_unmanaged (self,
- NM_UNMANAGED_USER | (val_bool ? NM_UNMANAGED_DEFAULT : NM_UNMANAGED_NONE),
- !val_bool,
- NM_DEVICE_STATE_REASON_USER_REQUESTED);
+ nm_device_set_unmanaged_flags (self,
+ NM_UNMANAGED_USER | (val_bool ? NM_UNMANAGED_DEFAULT : NM_UNMANAGED_NONE),
+ !val_bool,
+ NM_DEVICE_STATE_REASON_USER_REQUESTED);
break;
case PROP_AUTOCONNECT:
nm_device_set_autoconnect (self, g_value_get_boolean (value));
diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h
index a92719cd8a..1f656c5a8a 100644
--- a/src/devices/nm-device.h
+++ b/src/devices/nm-device.h
@@ -444,25 +444,27 @@ RfKillType nm_device_get_rfkill_type (NMDevice *device);
/**
* NMUnmanagedFlags:
* @NM_UNMANAGED_NONE: placeholder value
- * @NM_UNMANAGED_DEFAULT: %TRUE when unmanaged by default (ie, Generic devices)
* @NM_UNMANAGED_INTERNAL: %TRUE when unmanaged by internal decision (ie,
* because NM is sleeping or not managed for some other reason)
- * @NM_UNMANAGED_USER: %TRUE when unmanaged by user decision (via unmanaged-specs)
* @NM_UNMANAGED_PARENT: %TRUE when unmanaged due to parent device being unmanaged
- * @NM_UNMANAGED_EXTERNAL_DOWN: %TRUE when unmanaged because !IFF_UP and not created by NM
+ * @NM_UNMANAGED_LOOPBACK: %TRUE for unmanaging loopback device
* @NM_UNMANAGED_PLATFORM_INIT: %TRUE when unmanaged because platform link not
* yet initialized
- * @NM_UNMANAGED_LOOPBACK: %TRUE for unmanaging loopback device
+ * @NM_UNMANAGED_USER: %TRUE when unmanaged by user decision (via unmanaged-specs)
+ * @NM_UNMANAGED_DEFAULT: %TRUE when unmanaged by default (ie, Generic devices)
+ * @NM_UNMANAGED_EXTERNAL_DOWN: %TRUE when unmanaged because !IFF_UP and not created by NM
*/
-typedef enum {
+typedef enum { /*< skip >*/
NM_UNMANAGED_NONE = 0,
- NM_UNMANAGED_DEFAULT = (1LL << 0),
- NM_UNMANAGED_INTERNAL = (1LL << 1),
- NM_UNMANAGED_USER = (1LL << 2),
- NM_UNMANAGED_PARENT = (1LL << 3),
- NM_UNMANAGED_EXTERNAL_DOWN = (1LL << 4),
- NM_UNMANAGED_PLATFORM_INIT = (1LL << 5),
- NM_UNMANAGED_LOOPBACK = (1LL << 6),
+
+ NM_UNMANAGED_INTERNAL = (1LL << 0),
+ NM_UNMANAGED_PARENT = (1LL << 1),
+ NM_UNMANAGED_LOOPBACK = (1LL << 2),
+ NM_UNMANAGED_PLATFORM_INIT = (1LL << 3),
+ NM_UNMANAGED_USER = (1LL << 4),
+
+ NM_UNMANAGED_DEFAULT = (1LL << 8),
+ NM_UNMANAGED_EXTERNAL_DOWN = (1LL << 11),
/* Boundary value */
__NM_UNMANAGED_LAST,
@@ -471,16 +473,16 @@ typedef enum {
} NMUnmanagedFlags;
gboolean nm_device_get_managed (NMDevice *device);
-gboolean nm_device_get_unmanaged (NMDevice *device, NMUnmanagedFlags flag);
-void nm_device_set_unmanaged (NMDevice *device,
- NMUnmanagedFlags flag,
- gboolean unmanaged,
- NMDeviceStateReason reason);
-void nm_device_set_unmanaged_by_device_spec (NMDevice *self, const GSList *unmanaged_specs);
+NMUnmanagedFlags nm_device_get_unmanaged_flags (NMDevice *device, NMUnmanagedFlags flag);
+void nm_device_set_unmanaged_flags (NMDevice *device,
+ NMUnmanagedFlags flag,
+ gboolean unmanaged,
+ NMDeviceStateReason reason);
+void nm_device_set_unmanaged_flags_by_device_spec (NMDevice *self, const GSList *unmanaged_specs);
+void nm_device_set_unmanaged_flags_initial (NMDevice *device,
+ NMUnmanagedFlags flag,
+ gboolean unmanaged);
void nm_device_set_unmanaged_quitting (NMDevice *device);
-void nm_device_set_unmanaged_initial (NMDevice *device,
- NMUnmanagedFlags flag,
- gboolean unmanaged);
gboolean nm_device_get_is_nm_owned (NMDevice *device);
@@ -501,6 +503,7 @@ gboolean nm_device_unrealize (NMDevice *device,
GError **error);
gboolean nm_device_get_autoconnect (NMDevice *device);
+void nm_device_set_autoconnect (NMDevice *device, gboolean autoconnect);
void nm_device_state_changed (NMDevice *device,
NMDeviceState state,
diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
index 6fc827e00b..edecd24d8b 100644
--- a/src/devices/wwan/nm-device-modem.c
+++ b/src/devices/wwan/nm-device-modem.c
@@ -106,7 +106,7 @@ modem_prepare_result (NMModem *modem,
* the device to be auto-activated anymore, which would risk locking
* the SIM if the incorrect PIN continues to be used.
*/
- g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, FALSE, NULL);
+ nm_device_set_autoconnect (device, FALSE);
_LOGI (LOGD_MB, "disabling autoconnect due to failed SIM PIN");
}
diff --git a/src/nm-manager.c b/src/nm-manager.c
index d76b5a7248..d5c86fb8b5 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -829,7 +829,7 @@ remove_device (NMManager *manager,
if (quitting)
nm_device_set_unmanaged_quitting (device);
else
- nm_device_set_unmanaged (device, NM_UNMANAGED_INTERNAL, TRUE, NM_DEVICE_STATE_REASON_REMOVED);
+ nm_device_set_unmanaged_flags (device, NM_UNMANAGED_INTERNAL, TRUE, NM_DEVICE_STATE_REASON_REMOVED);
} else if (quitting && nm_config_get_configure_and_quit (nm_config_get ())) {
nm_device_spawn_iface_helper (device);
}
@@ -1128,7 +1128,7 @@ system_unmanaged_devices_changed_cb (NMSettings *settings,
unmanaged_specs = nm_settings_get_unmanaged_specs (priv->settings);
for (iter = priv->devices; iter; iter = g_slist_next (iter))
- nm_device_set_unmanaged_by_device_spec (NM_DEVICE (iter->data), unmanaged_specs);
+ nm_device_set_unmanaged_flags_by_device_spec (NM_DEVICE (iter->data), unmanaged_specs);
}
static void
@@ -1623,7 +1623,7 @@ can_start_device (NMManager *self, NMDevice *device)
{
return nm_device_is_real (device)
&& !manager_sleeping (self)
- && !nm_device_get_unmanaged (device, NM_UNMANAGED_ALL & ~NM_UNMANAGED_DEFAULT);
+ && !nm_device_get_unmanaged_flags (device, NM_UNMANAGED_ALL & ~NM_UNMANAGED_DEFAULT);
}
static gboolean
@@ -1665,7 +1665,7 @@ recheck_assume_connection (NMDevice *device, gpointer user_data)
NM_DEVICE_STATE_REASON_CONFIG_FAILED);
/* Return default-unmanaged devices to their original state */
- if (nm_device_get_unmanaged (device, NM_UNMANAGED_DEFAULT)) {
+ if (nm_device_get_unmanaged_flags (device, NM_UNMANAGED_DEFAULT)) {
nm_device_state_changed (device,
NM_DEVICE_STATE_UNMANAGED,
NM_DEVICE_STATE_REASON_CONFIG_FAILED);
@@ -1832,12 +1832,12 @@ add_device (NMManager *self, NMDevice *device)
nm_log_info (LOGD_HW, "(%s): new %s device", iface, type_desc);
unmanaged_specs = nm_settings_get_unmanaged_specs (priv->settings);
- nm_device_set_unmanaged_initial (device,
- NM_UNMANAGED_USER,
- nm_device_spec_match_list (device, unmanaged_specs));
- nm_device_set_unmanaged_initial (device,
- NM_UNMANAGED_INTERNAL,
- manager_sleeping (self));
+ nm_device_set_unmanaged_flags_initial (device,
+ NM_UNMANAGED_USER,
+ nm_device_spec_match_list (device, unmanaged_specs));
+ nm_device_set_unmanaged_flags_initial (device,
+ NM_UNMANAGED_INTERNAL,
+ manager_sleeping (self));
dbus_path = nm_exported_object_export (NM_EXPORTED_OBJECT (device));
nm_log_dbg (LOGD_DEVICE, "(%s): exported as %s", nm_device_get_iface (device), dbus_path);
@@ -3746,7 +3746,7 @@ do_sleep_wake (NMManager *self, gboolean sleeping_changed)
if (suspending && device_is_wake_on_lan (device))
continue;
- nm_device_set_unmanaged (device, NM_UNMANAGED_INTERNAL, TRUE, NM_DEVICE_STATE_REASON_SLEEPING);
+ nm_device_set_unmanaged_flags (device, NM_UNMANAGED_INTERNAL, TRUE, NM_DEVICE_STATE_REASON_SLEEPING);
}
} else {
nm_log_info (LOGD_SUSPEND, "%s...", waking_from_suspend ? "waking up" : "re-enabling");
@@ -3761,7 +3761,7 @@ do_sleep_wake (NMManager *self, gboolean sleeping_changed)
if (nm_device_is_software (device))
continue;
if (device_is_wake_on_lan (device))
- nm_device_set_unmanaged (device, NM_UNMANAGED_INTERNAL, TRUE, NM_DEVICE_STATE_REASON_SLEEPING);
+ nm_device_set_unmanaged_flags (device, NM_UNMANAGED_INTERNAL, TRUE, NM_DEVICE_STATE_REASON_SLEEPING);
}
}
@@ -3795,9 +3795,9 @@ do_sleep_wake (NMManager *self, gboolean sleeping_changed)
nm_device_set_enabled (device, enabled);
}
- g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, TRUE, NULL);
+ nm_device_set_autoconnect (device, TRUE);
- nm_device_set_unmanaged (device, NM_UNMANAGED_INTERNAL, FALSE, NM_DEVICE_STATE_REASON_NOW_MANAGED);
+ nm_device_set_unmanaged_flags (device, NM_UNMANAGED_INTERNAL, FALSE, NM_DEVICE_STATE_REASON_NOW_MANAGED);
}
}