From 11d8f21b6876c823883663d2224b9d49870c0129 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 13 Mar 2014 10:59:02 -0500 Subject: [PATCH] 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. --- src/devices/nm-device-wifi.c | 5 +++-- src/devices/nm-device.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/devices/nm-device-wifi.c b/src/devices/nm-device-wifi.c index 363b83ab5..d5398773b 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 bdfc63c0a..b3cccc7ad 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); }