int ret = 0;
struct list_head *phead, *plist, *ptmp;
struct wlan_network *pnetwork = NULL;
- struct cfg80211_ssid ndis_ssid;
+ struct cfg80211_ssid ssid;
u8 *dst_ssid;
- u8 *src_ssid;
u8 *dst_bssid;
- const u8 *src_bssid;
/* u8 matched_by_bssid = false; */
/* u8 matched_by_ssid = false; */
u8 matched = false;
goto exit;
}
- if (!sme->ssid || !sme->ssid_len) {
+ if (!sme->ssid || !sme->ssid_len ||
+ sme->ssid_len > IEEE80211_MAX_SSID_LEN) {
ret = -EINVAL;
goto exit;
}
- if (sme->ssid_len > IEEE80211_MAX_SSID_LEN) {
- ret = -E2BIG;
- goto exit;
- }
-
- memset(&ndis_ssid, 0, sizeof(struct cfg80211_ssid));
- ndis_ssid.ssid_len = sme->ssid_len;
- memcpy(ndis_ssid.ssid, sme->ssid, sme->ssid_len);
-
- DBG_8723A("ssid =%s, len =%zu\n", ndis_ssid.ssid, sme->ssid_len);
+ DBG_8723A("ssid =%s, len =%zu\n", sme->ssid, sme->ssid_len);
if (sme->bssid)
DBG_8723A("bssid =" MAC_FMT "\n", MAC_ARG(sme->bssid));
rtw_scan_abort23a(padapter);
}
+ memset(ssid.ssid, 0, sizeof(struct cfg80211_ssid));
+
spin_lock_bh(&queue->lock);
phead = get_list_head(queue);
}
if (sme->bssid) {
- src_bssid = sme->bssid;
-
- if (ether_addr_equal(dst_bssid, src_bssid)) {
+ if (ether_addr_equal(dst_bssid, sme->bssid)) {
DBG_8723A("matched by bssid\n");
- ndis_ssid.ssid_len =
- pnetwork->network.Ssid.ssid_len;
- memcpy(ndis_ssid.ssid,
- pnetwork->network.Ssid.ssid,
+ memcpy(ssid.ssid, pnetwork->network.Ssid.ssid,
pnetwork->network.Ssid.ssid_len);
+ ssid.ssid_len = pnetwork->network.Ssid.ssid_len;
matched = true;
break;
}
-
} else if (sme->ssid && sme->ssid_len) {
- src_ssid = ndis_ssid.ssid;
-
- if ((!memcmp(dst_ssid, src_ssid, ndis_ssid.ssid_len)) &&
- (pnetwork->network.Ssid.ssid_len ==
- ndis_ssid.ssid_len)) {
+ if (!memcmp(dst_ssid, sme->ssid, sme->ssid_len) &&
+ pnetwork->network.Ssid.ssid_len == sme->ssid_len) {
DBG_8723A("matched by ssid\n");
+
+ memcpy(ssid.ssid, sme->ssid, sme->ssid_len);
+ ssid.ssid_len = sme->ssid_len;
+
matched = true;
break;
}
spin_unlock_bh(&queue->lock);
- if (!matched || (pnetwork == NULL)) {
+ if (!matched || !pnetwork) {
ret = -ENOENT;
DBG_8723A("connect, matched == false, goto exit\n");
goto exit;
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen;
- ret =
- rtw_cfg80211_set_wpa_version(psecuritypriv,
- sme->crypto.wpa_versions);
+ ret = rtw_cfg80211_set_wpa_version(psecuritypriv,
+ sme->crypto.wpa_versions);
if (ret < 0)
goto exit;
ret = rtw_cfg80211_set_cipher(psecuritypriv,
sme->crypto.cipher_group, false);
if (ret < 0)
- return ret;
+ goto exit;
if (sme->crypto.n_akm_suites) {
ret = rtw_cfg80211_set_key_mgt(psecuritypriv,
/* rtw_set_802_11_encryption_mode(padapter,
padapter->securitypriv.ndisencryptstatus); */
- if (rtw_set_ssid(padapter, &ndis_ssid) != _SUCCESS) {
+ if (rtw_set_ssid(padapter, &ssid) != _SUCCESS) {
ret = -EBUSY;
goto exit;
}