FreeBSD Bugzilla – Attachment 234903 Details for
Bug 264238
wpa_supplicant 2.10 fails to associate to open secondary VAP when primary VAP is WPA
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proof of Concept solution
POC-solution.diff (text/plain), 2.87 KB, created by
Cy Schubert
on 2022-06-24 00:01:56 UTC
(
hide
)
Description:
Proof of Concept solution
Filename:
MIME Type:
Creator:
Cy Schubert
Created:
2022-06-24 00:01:56 UTC
Size:
2.87 KB
patch
obsolete
>diff --git a/contrib/wpa/src/drivers/driver_bsd.c b/contrib/wpa/src/drivers/driver_bsd.c >index c455bc931036..b39198b7249b 100644 >--- a/contrib/wpa/src/drivers/driver_bsd.c >+++ b/contrib/wpa/src/drivers/driver_bsd.c >@@ -1209,6 +1209,10 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params) > int privacy; > int ret = 0; > >+ /* XXX woraround for PR/264238 until a better solution can be found */ >+ const u8 *wpa_ie_save; >+ size_t wpa_ie_len_save; >+ > wpa_printf(MSG_DEBUG, > "%s: ssid '%.*s' wpa ie len %u pairwise %u group %u key mgmt %u" > , __func__ >@@ -1256,9 +1260,26 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params) > ret = -1; > if (wpa_driver_bsd_set_auth_alg(drv, params->auth_alg) < 0) > ret = -1; >+ >+ /* XXX woraround for PR/264238 until a better solution can be found */ >+ if (params->pairwise_suite == WPA_CIPHER_NONE && >+ params->group_suite == WPA_CIPHER_NONE && >+ params->key_mgmt_suite == WPA_KEY_MGMT_NONE && >+ params->wpa_ie_len != 0) { >+ wpa_ie_save = params->wpa_ie; >+ wpa_ie_len_save = params->wpa_ie_len; >+ params->wpa_ie = NULL; >+ params->wpa_ie_len = 0; >+ } else { >+ wpa_ie_save = NULL; >+ wpa_ie_len_save = 0; >+ } >+ > /* XXX error handling is wrong but unclear what to do... */ >- if (wpa_driver_bsd_set_wpa_ie(drv, params->wpa_ie, params->wpa_ie_len) < 0) >- return -1; >+ if (wpa_driver_bsd_set_wpa_ie(drv, params->wpa_ie, params->wpa_ie_len) < 0) { >+ ret = -1; >+ goto bsd_assoc_exit; >+ } > > privacy = !(params->pairwise_suite == WPA_CIPHER_NONE && > params->group_suite == WPA_CIPHER_NONE && >@@ -1266,20 +1287,26 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params) > params->wpa_ie_len == 0); > wpa_printf(MSG_DEBUG, "%s: set PRIVACY %u", __func__, privacy); > >- if (set80211param(drv, IEEE80211_IOC_PRIVACY, privacy) < 0) >- return -1; >+ if (set80211param(drv, IEEE80211_IOC_PRIVACY, privacy) < 0) { >+ ret = -1; >+ goto bsd_assoc_exit; >+ } > > if (params->wpa_ie_len && > set80211param(drv, IEEE80211_IOC_WPA, >- params->wpa_ie[0] == WLAN_EID_RSN ? 2 : 1) < 0) >- return -1; >+ params->wpa_ie[0] == WLAN_EID_RSN ? 2 : 1) < 0) { >+ ret = -1; >+ goto bsd_assoc_exit; >+ } > > /* > * NB: interface must be marked UP for association > * or scanning (ap_scan=2) > */ >- if (bsd_get_iface_flags(drv) < 0) >- return -1; >+ if (bsd_get_iface_flags(drv) < 0) { >+ ret = -1; >+ goto bsd_assoc_exit; >+ } > > os_memset(&mlme, 0, sizeof(mlme)); > mlme.im_op = IEEE80211_MLME_ASSOC; >@@ -1289,7 +1316,10 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params) > if (params->bssid != NULL) > os_memcpy(mlme.im_macaddr, params->bssid, IEEE80211_ADDR_LEN); > if (set80211var(drv, IEEE80211_IOC_MLME, &mlme, sizeof(mlme)) < 0) >- return -1; >+ ret = -1; >+bsd_assoc_exit: >+ params->wpa_ie = wpa_ie_save; >+ params->wpa_ie_len = wpa_ie_len_save; > return ret; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 264238
:
234405
|
234407
|
234478
|
234491
|
234669
|
234682
|
234695
|
234745
|
234801
|
234807
|
234808
|
234816
|
234848
|
234857
|
234903
|
234915
|
235029
|
235030
|
235049
|
235050
|
235051
|
235053
|
235055