summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-08-29 16:45:12 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2019-09-03 16:53:04 +0200
commit4bc415642495a492aba2eccfc3e16b1da34df287 (patch)
tree1e87997a975956a6dca7e17b2bfd656bccec9c4f
parent6a7c2d44aee466d11f2a5b94cc6a229be6ff5c88 (diff)
downloadNetworkManager-4bc415642495a492aba2eccfc3e16b1da34df287.tar.gz
device: don't set nm-owned flag if realize() fails
The nm-owned flag indicates whether the device was created by NM. If the realization step fails, the device was not created and so nm-owned should not be updated.
-rw-r--r--src/devices/nm-device.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 5310290743..21450b4aa0 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -4165,11 +4165,12 @@ nm_device_create_and_realize (NMDevice *self,
nm_auto_nmpobj const NMPObject *plink_keep_alive = NULL;
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
const NMPlatformLink *plink;
+ gboolean nm_owned;
/* Must be set before device is realized */
plink = nm_platform_link_get_by_ifname (nm_device_get_platform (self), priv->iface);
- priv->nm_owned = !plink || !link_type_compatible (self, plink->type, NULL, NULL);
- _LOGD (LOGD_DEVICE, "create (is %snm-owned)", priv->nm_owned ? "" : "not ");
+ nm_owned = !plink || !link_type_compatible (self, plink->type, NULL, NULL);
+ _LOGD (LOGD_DEVICE, "create (is %snm-owned)", nm_owned ? "" : "not ");
plink = NULL;
/* Create any resources the device needs */
@@ -4182,6 +4183,8 @@ nm_device_create_and_realize (NMDevice *self,
}
}
+ priv->nm_owned = nm_owned;
+
realize_start_setup (self,
plink,
FALSE, /* assume_state_guess_assume */