Import bsd_configure_wpa() to sync with upstream code.

This commit is contained in:
Bernhard Schmidt 2010-12-18 20:17:10 +00:00
parent 916753954d
commit 5db98cc304
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216536

View file

@ -263,6 +263,17 @@ bsd_set_key(const char *ifname, void *priv, enum wpa_alg alg,
return set80211var(priv, IEEE80211_IOC_WPAKEY, &wk, sizeof(wk));
}
static int
bsd_configure_wpa(void *priv, struct wpa_bss_params *params)
{
wpa_printf(MSG_DEBUG, "%s: enable WPA= 0x%x", __func__, params->wpa);
if (set80211param(priv, IEEE80211_IOC_WPA, params->wpa)) {
printf("Unable to set WPA to %u\n", params->wpa);
return -1;
}
return 0;
}
static int
bsd_set_ieee8021x(void *priv, struct wpa_bss_params *params)
{
@ -278,7 +289,7 @@ bsd_set_ieee8021x(void *priv, struct wpa_bss_params *params)
__func__);
return -1;
}
if (params->wpa && set80211param(priv,IEEE80211_IOC_WPA, params->wpa)) {
if (params->wpa && bsd_configure_wpa(priv, params) != 0) {
wpa_printf(MSG_ERROR, "%s: Failed to configure WPA state",
__func__);
return -1;