diff options
author | Francesco Giudici <fgiudici@redhat.com> | 2017-05-04 11:59:11 +0200 |
---|---|---|
committer | Francesco Giudici <fgiudici@redhat.com> | 2017-05-04 17:12:03 +0200 |
commit | 74dac5f516eedb560c3f9fba8418a773731a2515 (patch) | |
tree | 1e97ac05363fb8a8e5b3b0e78db6ce8315b154cd /src/nm-manager.c | |
parent | 40dadc7ac4ba0f0d1514f1c61ae46950e0bb06de (diff) | |
download | NetworkManager-74dac5f516eedb560c3f9fba8418a773731a2515.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
(cherry picked from commit acf1067a455b02b60985e209df568d3fcc3fac9e)
Diffstat (limited to 'src/nm-manager.c')
-rw-r--r-- | src/nm-manager.c | 6 |
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); |