summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-11-08 11:42:50 +0100
committerThomas Haller <thaller@redhat.com>2017-11-08 11:45:33 +0100
commit45da11f37068059df5d36115d80bebd15fc92188 (patch)
treeb7f950fa41803ec2038586cd469d417ffeeac50e
parent7074b88a6a3f61066e42b3f136ac0c0f6e189b0c (diff)
downloadNetworkManager-45da11f37068059df5d36115d80bebd15fc92188.tar.gz
device: minor refactoring of condition in nm_device_autoconnect_allowed()
Makes it clearer what is happening (to me).
-rw-r--r--src/devices/nm-device.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 4692590b92..1dd24fe8f0 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -4307,9 +4307,12 @@ nm_device_autoconnect_allowed (NMDevice *self)
if (!nm_device_get_enabled (self))
return FALSE;
- /* Unrealized devices can always autoconnect. */
- if (nm_device_is_real (self) && priv->state < NM_DEVICE_STATE_DISCONNECTED)
- return FALSE;
+ if (nm_device_is_real (self)) {
+ if (priv->state < NM_DEVICE_STATE_DISCONNECTED)
+ return FALSE;
+ } else {
+ /* Unrealized devices can always autoconnect. */
+ }
/* The 'autoconnect-allowed' signal is emitted on a device to allow
* other listeners to block autoconnect on the device if they wish.