wifi: add HIDDEN flag for completed connections without an AP (rh #1069844)

If an AP object is not given, and no compatible AP can be found
in the scan list, the AP is most likely not broadcasting its SSID
and should be marked as 'hidden'.
This commit is contained in:
Dan Williams 2014-03-03 11:49:28 -06:00
parent 85905a1ecf
commit 787455bae1

View file

@ -1142,6 +1142,7 @@ complete_connection (NMDevice *device,
NMAccessPoint *ap = NULL;
const GByteArray *ssid = NULL;
GSList *iter;
gboolean hidden = FALSE;
s_wifi = nm_connection_get_setting_wireless (connection);
s_wsec = nm_connection_get_setting_wireless_security (connection);
@ -1191,6 +1192,8 @@ complete_connection (NMDevice *device,
g_slist_free (settings);
if (!valid)
return FALSE;
hidden = TRUE;
}
} else {
ap = get_ap_by_path (self, specific_object);
@ -1268,6 +1271,9 @@ complete_connection (NMDevice *device,
g_free (str_ssid);
g_free (format);
if (hidden)
g_object_set (s_wifi, NM_SETTING_WIRELESS_HIDDEN, TRUE, NULL);
setting_mac = nm_setting_wireless_get_mac_address (s_wifi);
if (setting_mac) {
/* Make sure the setting MAC (if any) matches the device's permanent MAC */