summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-03-13 10:59:02 -0500
committerDan Williams <dcbw@redhat.com>2014-03-13 11:04:56 -0500
commit11d8f21b6876c823883663d2224b9d49870c0129 (patch)
tree1c4d2baacec9e26297aafc4910853eb6f7a23018
parentb02353e954dbb7291a7932a78d9c4e4aa15f8c4e (diff)
downloadNetworkManager-11d8f21b6876c823883663d2224b9d49870c0129.tar.gz
wifi: fix some warnings caused by hidden SSID patches (23a5ae2f) (rh #1069844)
It could also cause nm_device_connection_is_available() to return TRUE for wifi devices, for connections that were not wifi.
-rw-r--r--src/devices/nm-device-wifi.c5
-rw-r--r--src/devices/nm-device.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/devices/nm-device-wifi.c b/src/devices/nm-device-wifi.c
index 363b83ab54..d5398773ba 100644
--- a/src/devices/nm-device-wifi.c
+++ b/src/devices/nm-device-wifi.c
@@ -1060,6 +1060,9 @@ _internal_check_connection_available (NMDevice *device,
const char *mode;
GSList *ap_iter = NULL;
+ s_wifi = nm_connection_get_setting_wireless (connection);
+ g_return_val_if_fail (s_wifi, FALSE);
+
if (specific_object) {
NMAccessPoint *ap;
@@ -1067,8 +1070,6 @@ _internal_check_connection_available (NMDevice *device,
return ap ? nm_ap_check_compatible (ap, connection) : FALSE;
}
- s_wifi = nm_connection_get_setting_wireless (connection);
-
/* Ad-Hoc and AP connections are always available because they may be
* started at any time.
*/
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index bdfc63c0a9..b3cccc7ad2 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -7177,7 +7177,8 @@ nm_device_connection_is_available (NMDevice *device,
* activating but the network isn't available let the device recheck
* availability.
*/
- if (NM_DEVICE_GET_CLASS (device)->check_connection_available_wifi_hidden)
+ if ( nm_device_check_connection_compatible (device, connection, NULL)
+ && NM_DEVICE_GET_CLASS (device)->check_connection_available_wifi_hidden)
available = NM_DEVICE_GET_CLASS (device)->check_connection_available_wifi_hidden (device, connection);
}