cfg80211: Allow use_mfp to be specified with the connect command
The NL80211_ATTR_USE_MFP attribute was originally added for NL80211_CMD_ASSOCIATE, but it is actually as useful (if not even more useful) with NL80211_CMD_CONNECT, so process that attribute with the connect command, too. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
1c18f1452a
commit
cee00a959c
|
@ -1465,6 +1465,7 @@ struct cfg80211_ibss_params {
|
||||||
* @ie: IEs for association request
|
* @ie: IEs for association request
|
||||||
* @ie_len: Length of assoc_ie in octets
|
* @ie_len: Length of assoc_ie in octets
|
||||||
* @privacy: indicates whether privacy-enabled APs should be used
|
* @privacy: indicates whether privacy-enabled APs should be used
|
||||||
|
* @mfp: indicate whether management frame protection is used
|
||||||
* @crypto: crypto settings
|
* @crypto: crypto settings
|
||||||
* @key_len: length of WEP key for shared key authentication
|
* @key_len: length of WEP key for shared key authentication
|
||||||
* @key_idx: index of WEP key for shared key authentication
|
* @key_idx: index of WEP key for shared key authentication
|
||||||
|
@ -1485,6 +1486,7 @@ struct cfg80211_connect_params {
|
||||||
u8 *ie;
|
u8 *ie;
|
||||||
size_t ie_len;
|
size_t ie_len;
|
||||||
bool privacy;
|
bool privacy;
|
||||||
|
enum nl80211_mfp mfp;
|
||||||
struct cfg80211_crypto_settings crypto;
|
struct cfg80211_crypto_settings crypto;
|
||||||
const u8 *key;
|
const u8 *key;
|
||||||
u8 key_len, key_idx;
|
u8 key_len, key_idx;
|
||||||
|
|
|
@ -374,8 +374,8 @@
|
||||||
* requests to connect to a specified network but without separating
|
* requests to connect to a specified network but without separating
|
||||||
* auth and assoc steps. For this, you need to specify the SSID in a
|
* auth and assoc steps. For this, you need to specify the SSID in a
|
||||||
* %NL80211_ATTR_SSID attribute, and can optionally specify the association
|
* %NL80211_ATTR_SSID attribute, and can optionally specify the association
|
||||||
* IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC,
|
* IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP,
|
||||||
* %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
|
* %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
|
||||||
* %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and
|
* %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and
|
||||||
* %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.
|
* %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.
|
||||||
* Background scan period can optionally be
|
* Background scan period can optionally be
|
||||||
|
@ -958,7 +958,7 @@ enum nl80211_commands {
|
||||||
* @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is
|
* @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is
|
||||||
* used for the association (&enum nl80211_mfp, represented as a u32);
|
* used for the association (&enum nl80211_mfp, represented as a u32);
|
||||||
* this attribute can be used
|
* this attribute can be used
|
||||||
* with %NL80211_CMD_ASSOCIATE request
|
* with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests
|
||||||
*
|
*
|
||||||
* @NL80211_ATTR_STA_FLAGS2: Attribute containing a
|
* @NL80211_ATTR_STA_FLAGS2: Attribute containing a
|
||||||
* &struct nl80211_sta_flag_update.
|
* &struct nl80211_sta_flag_update.
|
||||||
|
|
|
@ -5932,6 +5932,15 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
|
||||||
connect.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
|
connect.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (info->attrs[NL80211_ATTR_USE_MFP]) {
|
||||||
|
connect.mfp = nla_get_u32(info->attrs[NL80211_ATTR_USE_MFP]);
|
||||||
|
if (connect.mfp != NL80211_MFP_REQUIRED &&
|
||||||
|
connect.mfp != NL80211_MFP_NO)
|
||||||
|
return -EINVAL;
|
||||||
|
} else {
|
||||||
|
connect.mfp = NL80211_MFP_NO;
|
||||||
|
}
|
||||||
|
|
||||||
if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) {
|
if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) {
|
||||||
connect.channel =
|
connect.channel =
|
||||||
ieee80211_get_channel(wiphy,
|
ieee80211_get_channel(wiphy,
|
||||||
|
|
|
@ -192,7 +192,8 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
|
||||||
prev_bssid,
|
prev_bssid,
|
||||||
params->ssid, params->ssid_len,
|
params->ssid, params->ssid_len,
|
||||||
params->ie, params->ie_len,
|
params->ie, params->ie_len,
|
||||||
false, ¶ms->crypto,
|
params->mfp != NL80211_MFP_NO,
|
||||||
|
¶ms->crypto,
|
||||||
params->flags, ¶ms->ht_capa,
|
params->flags, ¶ms->ht_capa,
|
||||||
¶ms->ht_capa_mask);
|
¶ms->ht_capa_mask);
|
||||||
if (err)
|
if (err)
|
||||||
|
|
Loading…
Reference in New Issue