nl80211: Add support for auth_alg auto-selection with connect command

When the SME is in the driver or cfg80211, the automatic selection
of auth_alg is done by leaving out the NL80211_ATTR_AUTH_TYPE
attribute from the NL80211_CMD_CONNECT command.
This commit is contained in:
Jouni Malinen 2011-04-07 14:53:40 +03:00 committed by Jouni Malinen
parent d332e7083c
commit 3f3602386e

View file

@ -4504,6 +4504,7 @@ static int wpa_driver_nl80211_connect(
struct nl_msg *msg;
enum nl80211_auth_type type;
int ret = 0;
int algs;
msg = nlmsg_alloc();
if (!msg)
@ -4538,6 +4539,19 @@ static int wpa_driver_nl80211_connect(
NLA_PUT(msg, NL80211_ATTR_IE, params->wpa_ie_len,
params->wpa_ie);
algs = 0;
if (params->auth_alg & WPA_AUTH_ALG_OPEN)
algs++;
if (params->auth_alg & WPA_AUTH_ALG_SHARED)
algs++;
if (params->auth_alg & WPA_AUTH_ALG_LEAP)
algs++;
if (algs > 1) {
wpa_printf(MSG_DEBUG, " * Leave out Auth Type for automatic "
"selection");
goto skip_auth_type;
}
if (params->auth_alg & WPA_AUTH_ALG_OPEN)
type = NL80211_AUTHTYPE_OPEN_SYSTEM;
else if (params->auth_alg & WPA_AUTH_ALG_SHARED)
@ -4552,6 +4566,7 @@ static int wpa_driver_nl80211_connect(
wpa_printf(MSG_DEBUG, " * Auth Type %d", type);
NLA_PUT_U32(msg, NL80211_ATTR_AUTH_TYPE, type);
skip_auth_type:
if (params->wpa_ie && params->wpa_ie_len) {
enum nl80211_wpa_versions ver;