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: 850c977953
This commit is contained in:
Francesco Giudici
2017-05-04 11:59:11 +02:00
parent 31e063fcb2
commit acf1067a45

View File

@@ -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);