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 1208-1213
wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params)
Link Here
|
1208 |
u32 mode; |
1209 |
u32 mode; |
1209 |
int privacy; |
1210 |
int privacy; |
1210 |
int ret = 0; |
1211 |
int ret = 0; |
|
|
1212 |
const u8 *ie; |
1211 |
|
1213 |
|
1212 |
wpa_printf(MSG_DEBUG, |
1214 |
wpa_printf(MSG_DEBUG, |
1213 |
"%s: ssid '%.*s' wpa ie len %u pairwise %u group %u key mgmt %u" |
1215 |
"%s: ssid '%.*s' wpa ie len %u pairwise %u group %u key mgmt %u" |
Lines 1256-1278
wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params)
Link Here
|
1256 |
ret = -1; |
1258 |
ret = -1; |
1257 |
if (wpa_driver_bsd_set_auth_alg(drv, params->auth_alg) < 0) |
1259 |
if (wpa_driver_bsd_set_auth_alg(drv, params->auth_alg) < 0) |
1258 |
ret = -1; |
1260 |
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 |
|
1263 |
privacy = !(params->pairwise_suite == WPA_CIPHER_NONE && |
1264 |
params->group_suite == WPA_CIPHER_NONE && |
1265 |
params->key_mgmt_suite == WPA_KEY_MGMT_NONE && |
1266 |
params->wpa_ie_len == 0); |
1267 |
wpa_printf(MSG_DEBUG, "%s: set PRIVACY %u", __func__, privacy); |
1268 |
|
1269 |
if (set80211param(drv, IEEE80211_IOC_PRIVACY, privacy) < 0) |
1270 |
return -1; |
1271 |
|
1261 |
|
1272 |
if (params->wpa_ie_len && |
1262 |
if (params->wpa_ie_len) { |
1273 |
set80211param(drv, IEEE80211_IOC_WPA, |
1263 |
ie = get_ie(params->wpa_ie, params->wpa_ie_len, WLAN_EID_RSN); |
1274 |
params->wpa_ie[0] == WLAN_EID_RSN ? 2 : 1) < 0) |
1264 |
if (ie) { |
1275 |
return -1; |
1265 |
/* XXX error handling is wrong but unclear what to do... */ |
|
|
1266 |
if (wpa_driver_bsd_set_wpa_ie(drv, params->wpa_ie, params->wpa_ie_len) < 0) |
1267 |
return -1; |
1268 |
|
1269 |
privacy = !(params->pairwise_suite == WPA_CIPHER_NONE && |
1270 |
params->group_suite == WPA_CIPHER_NONE && |
1271 |
params->key_mgmt_suite == WPA_KEY_MGMT_NONE); |
1272 |
wpa_printf(MSG_DEBUG, "%s: set PRIVACY %u", __func__, privacy); |
1273 |
|
1274 |
if (set80211param(drv, IEEE80211_IOC_PRIVACY, privacy) < 0) |
1275 |
return -1; |
1276 |
|
1277 |
if (params->wpa_ie_len && |
1278 |
set80211param(drv, IEEE80211_IOC_WPA, |
1279 |
params->wpa_ie[0] == WLAN_EID_RSN ? 2 : 1) < 0) |
1280 |
return -1; |
1281 |
} |
1282 |
} |
1276 |
|
1283 |
|
1277 |
/* |
1284 |
/* |
1278 |
* NB: interface must be marked UP for association |
1285 |
* NB: interface must be marked UP for association |