summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-06-29 17:52:53 +0200
committerThomas Haller <thaller@redhat.com>2015-06-30 16:45:27 +0200
commit4de4b0093a6ba5507285a52a9a59942654da14ae (patch)
tree43f297540fb7774d20dbdc02c24a0e076b5f88fc
parenta396ad2ac12171cc6d2f332083c25059a5648cf6 (diff)
downloadNetworkManager-4de4b0093a6ba5507285a52a9a59942654da14ae.tar.gz
platform:
-rw-r--r--src/devices/nm-device.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index af6d340cad..f44c81abfc 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -1118,7 +1118,6 @@ void
nm_device_finish_init (NMDevice *self)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
- gboolean platform_unmanaged = FALSE;
g_assert (priv->initialized == FALSE);
@@ -1140,7 +1139,10 @@ nm_device_finish_init (NMDevice *self)
* Currently it can happen that NM deletes 127.0.0.1 address. */
nm_device_set_initial_unmanaged_flag (self, NM_UNMANAGED_DEFAULT, TRUE);
} else if (priv->platform_link_initialized || (priv->is_nm_owned && nm_device_is_software (self))) {
- nm_platform_link_get_unmanaged (NM_PLATFORM_GET, priv->ifindex, &platform_unmanaged);
+ gboolean platform_unmanaged = FALSE;
+
+ if (!nm_platform_link_get_unmanaged (NM_PLATFORM_GET, priv->ifindex, &platform_unmanaged))
+ platform_unmanaged = FALSE;
nm_device_set_initial_unmanaged_flag (self, NM_UNMANAGED_DEFAULT, platform_unmanaged);
} else {
/* Hardware and externally-created software links stay unmanaged
@@ -1350,7 +1352,6 @@ device_link_changed (NMDevice *self)
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
NMUtilsIPv6IfaceId token_iid;
gboolean ip_ifname_changed = FALSE;
- gboolean platform_unmanaged = FALSE;
const char *udi;
NMPlatformLink info;
const NMPlatformLink *pllink;
@@ -1474,14 +1475,17 @@ device_link_changed (NMDevice *self)
}
if (priv->ifindex > 0 && !priv->platform_link_initialized && info.initialized) {
+ gboolean platform_unmanaged = FALSE;
+
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);
- }
+ if (nm_platform_link_get_unmanaged (NM_PLATFORM_GET, priv->ifindex, &platform_unmanaged))
+ platform_unmanaged = FALSE;
+
+ nm_device_set_unmanaged (self,
+ NM_UNMANAGED_DEFAULT,
+ platform_unmanaged,
+ NM_DEVICE_STATE_REASON_USER_REQUESTED);
nm_device_set_unmanaged (self,
NM_UNMANAGED_PLATFORM_INIT,