summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-06-07 17:34:47 +0200
committerThomas Haller <thaller@redhat.com>2017-06-07 22:24:59 +0200
commit85910c00c8df7181ff982166af7a79735fced852 (patch)
tree0b44c487a9c7805fdb01760148eab5544ee4338e
parent7d4b2b67a5ca49496051d03b86b52e04c2aced96 (diff)
downloadNetworkManager-85910c00c8df7181ff982166af7a79735fced852.tar.gz
manager: fix checking sys-iface-state when assuming devices
Originally 850c977 "device: track system interface state in NMDevice", intended that a connection can only be assumed initially when seeing a device the first time. Assuming later on was to be prevented using the sys-iface-state, which transits to MANAGED. That changed too much in behavior, because we used to assume external connections also when they are activated later on. So it attempted to get fixed by - acf1067 nm-manager: try assuming connections on managed devices - b6b7d90 manager: avoid generating in memory connections during startup for managed devices - 02e7476 device: mark device as sys-iface-state=external when assuming connection It's probably just wrong to prevent assuming connections based on the sys-iface-state. The patch already allowed SYS_IFACE_STATE_MANAGED, if priv->startup was reached. Note that priv->startup is certainly wrong to check because it merely tracks the D-Bus property "startup-complete", e.g whether we are still activating devices. If we already allow SYS_IFACE_STATE_MANAGED state to pass, then we certainly allow all other sys-iface-state types as well to proceed with assuming a connection. https://bugzilla.redhat.com/show_bug.cgi?id=1452062
-rw-r--r--src/nm-manager.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index ef61787148..16891ee88b 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -1835,8 +1835,6 @@ recheck_assume_connection (NMManager *self,
gboolean was_unmanaged = FALSE;
gboolean generated = FALSE;
NMDeviceState state;
- NMDeviceSysIfaceState if_state;
- NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
g_return_val_if_fail (NM_IS_MANAGER (self), FALSE);
g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
@@ -1848,12 +1846,6 @@ recheck_assume_connection (NMManager *self,
if (state > NM_DEVICE_STATE_DISCONNECTED)
return FALSE;
- if_state = nm_device_sys_iface_state_get (device);
- if (!priv->startup && (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);
if (!connection) {
_LOGD (LOGD_DEVICE, "(%s): can't assume; no connection",