mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-15 18:18:06 +02:00
wifi: always assume can_scan_ssid and use ap_scan=1 for infra mode
We should use ap_scan=1 *except* for AP/IBSS/AdHoc, where ap_scan=2 is required. ap_scan for "infra" mode is all historical and was for old, crappy, and proprietary drivers that we should really stop hacking stuff for. Those drivers did not support probe-scanning for hidden APs and thus the supplicant just had to send all the config to the driver and hope things worked. All relevant and non-crappy drivers these days support at least one SSID probe and thus is_broadcast affecting ap_scan should no longer be something we support. If you have an old, crappy WEXT/proprietary/staging driver, and you use hidden APs, you're doing it wrong. So, in short, we must keep the ap_scan=2 logic for AP+AdHoc, but we can remove the is_broadcast and has_scan_capa_ssid arguments and the code where they change ap_scan. https://bugzilla.redhat.com/show_bug.cgi?id=1025371#c18 Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
1283816b41
commit
3c52e383f9
9 changed files with 10 additions and 32 deletions
|
|
@ -2650,7 +2650,7 @@ remove_supplicant_timeouts (NMDeviceWifi *self)
|
|||
static NMSupplicantConfig *
|
||||
build_supplicant_config (NMDeviceWifi *self,
|
||||
NMConnection *connection,
|
||||
NMAccessPoint *ap)
|
||||
guint32 fixed_freq)
|
||||
{
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||
NMSupplicantConfig *config = NULL;
|
||||
|
|
@ -2674,9 +2674,7 @@ build_supplicant_config (NMDeviceWifi *self,
|
|||
|
||||
if (!nm_supplicant_config_add_setting_wireless (config,
|
||||
s_wireless,
|
||||
nm_ap_get_broadcast (ap),
|
||||
nm_ap_get_freq (ap),
|
||||
wifi_utils_can_scan_ssid (priv->wifi_data))) {
|
||||
fixed_freq)) {
|
||||
nm_log_err (LOGD_WIFI, "Couldn't add 802-11-wireless setting to supplicant config.");
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -2973,7 +2971,7 @@ act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason)
|
|||
ensure_hotspot_frequency (self, s_wireless, ap);
|
||||
|
||||
/* Build up the supplicant configuration */
|
||||
config = build_supplicant_config (self, connection, ap);
|
||||
config = build_supplicant_config (self, connection, nm_ap_get_freq (ap));
|
||||
if (config == NULL) {
|
||||
nm_log_err (LOGD_DEVICE | LOGD_WIFI,
|
||||
"Activation (%s/wireless): couldn't build wireless configuration.",
|
||||
|
|
|
|||
|
|
@ -334,9 +334,7 @@ nm_supplicant_config_get_blobs (NMSupplicantConfig * self)
|
|||
gboolean
|
||||
nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
|
||||
NMSettingWireless * setting,
|
||||
gboolean is_broadcast,
|
||||
guint32 fixed_freq,
|
||||
gboolean has_scan_capa_ssid)
|
||||
guint32 fixed_freq)
|
||||
{
|
||||
NMSupplicantConfigPrivate *priv;
|
||||
gboolean is_adhoc, is_ap;
|
||||
|
|
@ -353,12 +351,8 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
|
|||
is_ap = (mode && !strcmp (mode, "ap")) ? TRUE : FALSE;
|
||||
if (is_adhoc || is_ap)
|
||||
priv->ap_scan = 2;
|
||||
else if (is_broadcast == FALSE) {
|
||||
/* drivers that support scanning specific SSIDs should use
|
||||
* ap_scan=1, while those that do not should use ap_scan=2.
|
||||
*/
|
||||
priv->ap_scan = has_scan_capa_ssid ? 1 : 2;
|
||||
}
|
||||
else
|
||||
priv->ap_scan = 1;
|
||||
|
||||
id = nm_setting_wireless_get_ssid (setting);
|
||||
if (!nm_supplicant_config_add_option (self, "ssid", (char *) id->data, id->len, FALSE)) {
|
||||
|
|
|
|||
|
|
@ -65,9 +65,7 @@ GHashTable *nm_supplicant_config_get_blobs (NMSupplicantConfig *self);
|
|||
|
||||
gboolean nm_supplicant_config_add_setting_wireless (NMSupplicantConfig *self,
|
||||
NMSettingWireless *setting,
|
||||
gboolean is_broadcast,
|
||||
guint32 adhoc_freq,
|
||||
gboolean has_scan_capa_ssid);
|
||||
guint32 fixed_freq);
|
||||
|
||||
gboolean nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
|
||||
NMSettingWirelessSecurity *setting,
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ test_wifi_open (void)
|
|||
|
||||
config = nm_supplicant_config_new ();
|
||||
|
||||
success = nm_supplicant_config_add_setting_wireless (config, s_wifi, TRUE, 0, TRUE);
|
||||
success = nm_supplicant_config_add_setting_wireless (config, s_wifi, 0);
|
||||
ASSERT (success == TRUE,
|
||||
"wifi-open", "failed to add wireless setting to supplicant config.");
|
||||
|
||||
|
|
@ -272,7 +272,7 @@ test_wifi_wep_key (const char *detail,
|
|||
|
||||
config = nm_supplicant_config_new ();
|
||||
|
||||
success = nm_supplicant_config_add_setting_wireless (config, s_wifi, TRUE, 0, TRUE);
|
||||
success = nm_supplicant_config_add_setting_wireless (config, s_wifi, 0);
|
||||
ASSERT (success == TRUE,
|
||||
detail, "failed to add wireless setting to supplicant config.");
|
||||
|
||||
|
|
@ -405,7 +405,7 @@ test_wifi_wpa_psk (const char *detail,
|
|||
|
||||
config = nm_supplicant_config_new ();
|
||||
|
||||
success = nm_supplicant_config_add_setting_wireless (config, s_wifi, TRUE, 0, TRUE);
|
||||
success = nm_supplicant_config_add_setting_wireless (config, s_wifi, 0);
|
||||
ASSERT (success == TRUE,
|
||||
detail, "failed to add wireless setting to supplicant config.");
|
||||
|
||||
|
|
|
|||
|
|
@ -806,7 +806,6 @@ wifi_nl80211_init (const char *iface, int ifindex)
|
|||
|
||||
nl80211->freqs = device_info.freqs;
|
||||
nl80211->num_freqs = device_info.num_freqs;
|
||||
nl80211->parent.can_scan_ssid = device_info.can_scan_ssid;
|
||||
nl80211->parent.caps = device_info.caps;
|
||||
|
||||
nm_log_info (LOGD_HW | LOGD_WIFI,
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ struct WifiData {
|
|||
char *iface;
|
||||
int ifindex;
|
||||
NMDeviceWifiCapabilities caps;
|
||||
gboolean can_scan_ssid;
|
||||
|
||||
NM80211Mode (*get_mode) (WifiData *data);
|
||||
|
||||
|
|
|
|||
|
|
@ -630,7 +630,6 @@ wifi_wext_init (const char *iface, int ifindex, gboolean check_scan)
|
|||
*/
|
||||
scan_capa_range = (struct iw_range_with_scan_capa *) ⦥
|
||||
if (scan_capa_range->scan_capa & NM_IW_SCAN_CAPA_ESSID) {
|
||||
wext->parent.can_scan_ssid = TRUE;
|
||||
nm_log_info (LOGD_HW | LOGD_WIFI,
|
||||
"(%s): driver supports SSID scans (scan_capa 0x%02X).",
|
||||
wext->parent.iface,
|
||||
|
|
|
|||
|
|
@ -78,13 +78,6 @@ wifi_utils_get_caps (WifiData *data)
|
|||
return data->caps;
|
||||
}
|
||||
|
||||
gboolean
|
||||
wifi_utils_can_scan_ssid (WifiData *data)
|
||||
{
|
||||
g_return_val_if_fail (data != NULL, FALSE);
|
||||
return data->can_scan_ssid;
|
||||
}
|
||||
|
||||
NM80211Mode
|
||||
wifi_utils_get_mode (WifiData *data)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@ void wifi_utils_deinit (WifiData *data);
|
|||
|
||||
NMDeviceWifiCapabilities wifi_utils_get_caps (WifiData *data);
|
||||
|
||||
gboolean wifi_utils_can_scan_ssid (WifiData *data);
|
||||
|
||||
NM80211Mode wifi_utils_get_mode (WifiData *data);
|
||||
|
||||
gboolean wifi_utils_set_mode (WifiData *data, const NM80211Mode mode);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue