mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 01:20:07 +01:00
core: move helper macro for activating state to general location
This commit is contained in:
parent
671f00c86f
commit
06a40dcf73
2 changed files with 4 additions and 3 deletions
|
|
@ -42,8 +42,6 @@
|
|||
#include "nm-vpn-manager.h"
|
||||
#include "nm-modem.h"
|
||||
|
||||
#define STATE_IN_ACTIVATION_PHASE(state) ((state > NM_DEVICE_STATE_DISCONNECTED) && (state < NM_DEVICE_STATE_ACTIVATED))
|
||||
|
||||
typedef struct LookupThread LookupThread;
|
||||
|
||||
typedef void (*LookupCallback) (LookupThread *thread, gpointer user_data);
|
||||
|
|
@ -788,7 +786,7 @@ device_state_changed (NMDevice *device,
|
|||
/* Mark the connection invalid if it failed during activation so that
|
||||
* it doesn't get automatically chosen over and over and over again.
|
||||
*/
|
||||
if (connection && STATE_IN_ACTIVATION_PHASE (old_state)) {
|
||||
if (connection && IS_ACTIVATING_STATE (old_state)) {
|
||||
g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE));
|
||||
nm_info ("Marking connection '%s' invalid.", get_connection_id (connection));
|
||||
nm_connection_clear_secrets (connection);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@
|
|||
#define NM_IS_DEVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_INTERFACE))
|
||||
#define NM_DEVICE_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_DEVICE_INTERFACE, NMDeviceInterface))
|
||||
|
||||
#define IS_ACTIVATING_STATE(state) \
|
||||
(state > NM_DEVICE_STATE_DISCONNECTED && state < NM_DEVICE_STATE_ACTIVATED)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
NM_DEVICE_INTERFACE_ERROR_CONNECTION_ACTIVATING = 0,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue