Lines 14-19
Link Here
|
14 |
#include "driver.h" |
14 |
#include "driver.h" |
15 |
#include "eloop.h" |
15 |
#include "eloop.h" |
16 |
#include "common/ieee802_11_defs.h" |
16 |
#include "common/ieee802_11_defs.h" |
|
|
17 |
#include "common/ieee802_11_common.h" |
17 |
#include "common/wpa_common.h" |
18 |
#include "common/wpa_common.h" |
18 |
|
19 |
|
19 |
#include <ifaddrs.h> |
20 |
#include <ifaddrs.h> |
Lines 1256-1278
wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params)
Link Here
|
1256 |
ret = -1; |
1257 |
ret = -1; |
1257 |
if (wpa_driver_bsd_set_auth_alg(drv, params->auth_alg) < 0) |
1258 |
if (wpa_driver_bsd_set_auth_alg(drv, params->auth_alg) < 0) |
1258 |
ret = -1; |
1259 |
ret = -1; |
1259 |
/* XXX error handling is wrong but unclear what to do... */ |
|
|
1260 |
if (wpa_driver_bsd_set_wpa_ie(drv, params->wpa_ie, params->wpa_ie_len) < 0) |
1261 |
return -1; |
1262 |
|
1260 |
|
1263 |
privacy = !(params->pairwise_suite == WPA_CIPHER_NONE && |
1261 |
if (params->wpa_ie_len && get_ie(params->wpa_ie, params->wpa_ie_len, |
1264 |
params->group_suite == WPA_CIPHER_NONE && |
1262 |
WLAN_EID_RSN)) { |
1265 |
params->key_mgmt_suite == WPA_KEY_MGMT_NONE && |
1263 |
/* XXX error handling is wrong but unclear what to do... */ |
1266 |
params->wpa_ie_len == 0); |
1264 |
if (wpa_driver_bsd_set_wpa_ie(drv, params->wpa_ie, |
1267 |
wpa_printf(MSG_DEBUG, "%s: set PRIVACY %u", __func__, privacy); |
1265 |
params->wpa_ie_len) < 0) |
|
|
1266 |
return -1; |
1268 |
|
1267 |
|
1269 |
if (set80211param(drv, IEEE80211_IOC_PRIVACY, privacy) < 0) |
1268 |
privacy = !(params->pairwise_suite == WPA_CIPHER_NONE && |
1270 |
return -1; |
1269 |
params->group_suite == WPA_CIPHER_NONE && |
|
|
1270 |
params->key_mgmt_suite == WPA_KEY_MGMT_NONE); |
1271 |
wpa_printf(MSG_DEBUG, "%s: set PRIVACY %u", __func__, privacy); |
1271 |
|
1272 |
|
1272 |
if (params->wpa_ie_len && |
1273 |
if (set80211param(drv, IEEE80211_IOC_PRIVACY, privacy) < 0) |
1273 |
set80211param(drv, IEEE80211_IOC_WPA, |
1274 |
return -1; |
1274 |
params->wpa_ie[0] == WLAN_EID_RSN ? 2 : 1) < 0) |
1275 |
|
1275 |
return -1; |
1276 |
if (params->wpa_ie_len && |
|
|
1277 |
set80211param(drv, IEEE80211_IOC_WPA, |
1278 |
params->wpa_ie[0] == WLAN_EID_RSN ? 2 : 1) < 0) |
1279 |
return -1; |
1280 |
} |
1276 |
|
1281 |
|
1277 |
/* |
1282 |
/* |
1278 |
* NB: interface must be marked UP for association |
1283 |
* NB: interface must be marked UP for association |