summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Giudici <fgiudici@redhat.com>2017-05-04 11:59:11 +0200
committerFrancesco Giudici <fgiudici@redhat.com>2017-05-04 16:30:51 +0200
commitacf1067a455b02b60985e209df568d3fcc3fac9e (patch)
tree9e94e2315832dce76ba647198ed9e319524d1c1c
parent31e063fcb24cff2cda16dc95a69f990d98b5e285 (diff)
downloadNetworkManager-acf1067a455b02b60985e209df568d3fcc3fac9e.tar.gz
nm-manager: try assuming connections on managed devices
Commit 850c97795 ("device: track system interface state in NMDevice") introduced interface states for devices and prevented checking if a connection should be assumed on already managed devices. This prevented to properly manage the event of an ip configuration added externally to NM to a managed but not (yet) activated device. Fixes: 850c977953e4de3c8bbee64a3d2e8726c971761c
-rw-r--r--src/nm-manager.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 093a2a4fd3..d646e23ff7 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -1852,6 +1852,7 @@ recheck_assume_connection (NMManager *self,
gboolean was_unmanaged = FALSE;
gboolean generated = FALSE;
NMDeviceState state;
+ NMDeviceSysIfaceState if_state;
g_return_val_if_fail (NM_IS_MANAGER (self), FALSE);
g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
@@ -1866,7 +1867,10 @@ recheck_assume_connection (NMManager *self,
if (state > NM_DEVICE_STATE_DISCONNECTED)
return FALSE;
- if (nm_device_sys_iface_state_get (device) != NM_DEVICE_SYS_IFACE_STATE_EXTERNAL)
+ if_state = nm_device_sys_iface_state_get (device);
+ if (if_state == NM_DEVICE_SYS_IFACE_STATE_MANAGED)
+ nm_assert (!guess_assume && (assume_connection_uuid == NULL));
+ else if (if_state != NM_DEVICE_SYS_IFACE_STATE_EXTERNAL)
return FALSE;
connection = get_existing_connection (self, device, guess_assume, assume_connection_uuid, &generated);