diff options
author | Thomas Haller <thaller@redhat.com> | 2017-11-02 18:52:35 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-11-08 12:35:10 +0100 |
commit | f7e72d9d702ea78fe04b1a9000727da76a31b71b (patch) | |
tree | c8517f5ba00e8bc4b0fd018dcca9ad9ab2dbf13b /src | |
parent | bb0536fc0052a4b50794fdfad1cfd1936da80009 (diff) | |
download | NetworkManager-f7e72d9d702ea78fe04b1a9000727da76a31b71b.tar.gz |
policy: don't check autoconnect flag of connection in nm_device_can_auto_connect()
nm_device_can_auto_connect() only has one caller, auto_activate_device()
in NMPolicy.
That caller already checks whether the connection has autoconnect
enabled, so drop the duplicate check.
This saves some duplication, but it also makes some sense:
NMSettingsConnection has a complex blocking of autoconnect,
so just looking at connection.autoconnect is not enough in
any case to determine whether the connection should autoconnect.
We move thus more handling of autoconnect to NMPolicy, where
it belongs.
(cherry picked from commit 6fff832fe3b1086c226c8e26a6c3b4d413dde086)
Diffstat (limited to 'src')
-rw-r--r-- | src/devices/nm-device.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 6496aadea0..23d8235fd0 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -4366,8 +4366,6 @@ nm_device_can_auto_connect (NMDevice *self, NMConnection *connection, char **specific_object) { - NMSettingConnection *s_con; - g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); g_return_val_if_fail (!specific_object || !*specific_object, FALSE); @@ -4381,10 +4379,6 @@ nm_device_can_auto_connect (NMDevice *self, * over and over again. The caller is supposed to do that. */ nm_assert (nm_device_autoconnect_allowed (self)); - s_con = nm_connection_get_setting_connection (connection); - if (!nm_setting_connection_get_autoconnect (s_con)) - return FALSE; - if (!nm_device_check_connection_available (self, connection, NM_DEVICE_CHECK_CON_AVAILABLE_NONE, NULL)) return FALSE; |