diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index e19109336a..8490ffc95a 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -442,6 +442,11 @@ typedef struct _NMDevicePrivate { NML3ConfigMergeFlags l3config_merge_flags_x[2]; }; + union { + const NMDeviceSysIfaceState sys_iface_state; + NMDeviceSysIfaceState sys_iface_state_; + }; + bool carrier:1; bool ignore_carrier:1; @@ -453,8 +458,6 @@ typedef struct _NMDevicePrivate { bool default_route_metric_penalty_ip4_has:1; bool default_route_metric_penalty_ip6_has:1; - NMDeviceSysIfaceState sys_iface_state:2; - bool v4_route_table_initialized:1; bool v6_route_table_initialized:1; @@ -1423,7 +1426,7 @@ nm_device_sys_iface_state_set (NMDevice *self, _LOGT (LOGD_DEVICE, "sys-iface-state: %s -> %s", _sys_iface_state_to_str (priv->sys_iface_state), _sys_iface_state_to_str (sys_iface_state)); - priv->sys_iface_state = sys_iface_state; + priv->sys_iface_state_ = sys_iface_state; } /* this function only sets a flag, no immediate actions are initiated. @@ -18091,7 +18094,7 @@ nm_device_init (NMDevice *self) priv->unmanaged_mask = priv->unmanaged_flags; priv->available_connections = g_hash_table_new_full (nm_direct_hash, NULL, g_object_unref, NULL); priv->ip6_saved_properties = g_hash_table_new_full (nm_str_hash, g_str_equal, NULL, g_free); - priv->sys_iface_state = NM_DEVICE_SYS_IFACE_STATE_EXTERNAL; + priv->sys_iface_state_ = NM_DEVICE_SYS_IFACE_STATE_EXTERNAL; priv->v4_commit_first_time = TRUE; priv->v6_commit_first_time = TRUE; diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h index 36cae7a3aa..d9ac0022f8 100644 --- a/src/devices/nm-device.h +++ b/src/devices/nm-device.h @@ -16,7 +16,7 @@ #include "nm-rfkill-manager.h" #include "NetworkManagerUtils.h" -typedef enum { +typedef enum _nm_packed { NM_DEVICE_SYS_IFACE_STATE_EXTERNAL, NM_DEVICE_SYS_IFACE_STATE_ASSUME, NM_DEVICE_SYS_IFACE_STATE_MANAGED,