History

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.

Jouni Malinen committed 13 years ago

Commit cee00a91 parent 1c18f144 files · +16 −4Browse files

Unified · Split

4 files
  1. include/net/cfg80211.h +2 −0
  2. include/uapi/linux/nl80211.h +3 −3
  3. net/wireless/nl80211.c +9 −0
  4. net/wireless/sme.c +2 −1
include/net/cfg80211.h+2−0
@@ -1465,6 +1465,7 @@ struct cfg80211_ibss_params { · 1464 unmodified lines
1465 * @ie: IEs for association request1465 * @ie: IEs for association request
1466 * @ie_len: Length of assoc_ie in octets1466 * @ie_len: Length of assoc_ie in octets
1467 * @privacy: indicates whether privacy-enabled APs should be used1467 * @privacy: indicates whether privacy-enabled APs should be used
1468 * @mfp: indicate whether management frame protection is used
1468 * @crypto: crypto settings1469 * @crypto: crypto settings
1469 * @key_len: length of WEP key for shared key authentication1470 * @key_len: length of WEP key for shared key authentication
1470 * @key_idx: index of WEP key for shared key authentication1471 * @key_idx: index of WEP key for shared key authentication
@@ -1485,6 +1486,7 @@ struct cfg80211_connect_params { · 14 unmodified lines
1485 u8 *ie;1486 u8 *ie;
1486 size_t ie_len;1487 size_t ie_len;
1487 bool privacy;1488 bool privacy;
1489 enum nl80211_mfp mfp;
1488 struct cfg80211_crypto_settings crypto;1490 struct cfg80211_crypto_settings crypto;
1489 const u8 *key;1491 const u8 *key;
1490 u8 key_len, key_idx;1492 u8 key_len, key_idx;
include/uapi/linux/nl80211.h+3−3
@@ -374,8 +374,8 @@ · 373 unmodified lines
374 * requests to connect to a specified network but without separating374 * requests to connect to a specified network but without separating
375 * auth and assoc steps. For this, you need to specify the SSID in a375 * auth and assoc steps. For this, you need to specify the SSID in a
376 * %NL80211_ATTR_SSID attribute, and can optionally specify the association376 * %NL80211_ATTR_SSID attribute, and can optionally specify the association
377 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC,377 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP,
378 * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,378 * %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
379 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and379 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and
380 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.380 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.
381 * Background scan period can optionally be381 * Background scan period can optionally be
@@ -958,7 +958,7 @@ enum nl80211_commands { · 576 unmodified lines
958 * @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is958 * @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is
959 * used for the association (&enum nl80211_mfp, represented as a u32);959 * used for the association (&enum nl80211_mfp, represented as a u32);
960 * this attribute can be used960 * this attribute can be used
961 * with %NL80211_CMD_ASSOCIATE request961 * with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests
962 *962 *
963 * @NL80211_ATTR_STA_FLAGS2: Attribute containing a963 * @NL80211_ATTR_STA_FLAGS2: Attribute containing a
964 * &struct nl80211_sta_flag_update.964 * &struct nl80211_sta_flag_update.
net/wireless/nl80211.c+9−0
@@ -5932,6 +5932,15 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) · 5931 unmodified lines
5932 connect.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);5932 connect.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
5933 }5933 }
5934 5934
5935 if (info->attrs[NL80211_ATTR_USE_MFP]) {
5936 connect.mfp = nla_get_u32(info->attrs[NL80211_ATTR_USE_MFP]);
5937 if (connect.mfp != NL80211_MFP_REQUIRED &&
5938 connect.mfp != NL80211_MFP_NO)
5939 return -EINVAL;
5940 } else {
5941 connect.mfp = NL80211_MFP_NO;
5942 }
5943
5935 if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) {5944 if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) {
5936 connect.channel =5945 connect.channel =
5937 ieee80211_get_channel(wiphy,5946 ieee80211_get_channel(wiphy,
net/wireless/sme.c+2−1
@@ -192,7 +192,8 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev) · 191 unmodified lines
192 prev_bssid,192 prev_bssid,
193 params->ssid, params->ssid_len,193 params->ssid, params->ssid_len,
194 params->ie, params->ie_len,194 params->ie, params->ie_len,
195 false, &params->crypto,195 params->mfp != NL80211_MFP_NO,
196 &params->crypto,
196 params->flags, &params->ht_capa,197 params->flags, &params->ht_capa,
197 &params->ht_capa_mask);198 &params->ht_capa_mask);
198 if (err)199 if (err)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t