Skip to content

Commit f45cbe6

Browse files
AviSternjmberg-intel
authored andcommitted
nl80211: add authorized flag to ROAM event
Drivers that initiate roaming while being connected to a network that uses 802.1X authentication need to inform user space if 802.1X authentication is further required after roaming. For example, when using the Fast transition protocol, roaming within the mobility domain does not require new 802.1X authentication, but roaming to another mobility domain does. In addition, some drivers may not support 802.1X authentication (so it has to be done in user space), while other drivers do. Add a flag to the roaming notification to indicate if user space is required to do 802.1X authentication after the roaming or not. This flag will only be used for networks that use 802.1X authentication. For networks that do not use 802.1X authentication it is assumed that no further action is required from user space after the roaming notification. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> [arend.vanspriel@broadcom.com reuse NL80211_ATTR_PORT_AUTHORIZED] Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> [rebase to apply w/o the flag in CONNECT] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 3a00df5 commit f45cbe6

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎include/net/cfg80211.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5441,6 +5441,9 @@ cfg80211_connect_timeout(struct net_device *dev, const u8 *bssid,
54415441
* @req_ie_len: association request IEs length
54425442
* @resp_ie: association response IEs (may be %NULL)
54435443
* @resp_ie_len: assoc response IEs length
5444+
* @authorized: true if the 802.1X authentication was done by the driver or is
5445+
* not needed (e.g., when Fast Transition protocol was used), false
5446+
* otherwise. Ignored for networks that don't use 802.1X authentication.
54445447
*/
54455448
struct cfg80211_roam_info {
54465449
struct ieee80211_channel *channel;
@@ -5450,6 +5453,7 @@ struct cfg80211_roam_info {
54505453
size_t req_ie_len;
54515454
const u8 *resp_ie;
54525455
size_t resp_ie_len;
5456+
bool authorized;
54535457
};
54545458

54555459
/**

‎include/uapi/linux/nl80211.h‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,12 @@
571571
* well to remain backwards compatible.
572572
* @NL80211_CMD_ROAM: request that the card roam (currently not implemented),
573573
* sent as an event when the card/driver roamed by itself.
574+
* When used as an event, and the driver roamed in a network that requires
575+
* 802.1X authentication, %NL80211_ATTR_PORT_AUTHORIZED should be set
576+
* if the 802.1X authentication was done by the driver or if roaming was
577+
* done using Fast Transition protocol (in which case 802.1X authentication
578+
* is not needed). If %NL80211_ATTR_PORT_AUTHORIZED is not set, user space
579+
* is responsible for the 802.1X authentication.
574580
* @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify
575581
* userspace that a connection was dropped by the AP or due to other
576582
* reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and
@@ -2130,6 +2136,10 @@ enum nl80211_commands {
21302136
* in %NL80211_CMD_CONNECT to indicate that for 802.1X authentication it
21312137
* wants to use the supported offload of the 4-way handshake.
21322138
* @NL80211_ATTR_PMKR0_NAME: PMK-R0 Name for offloaded FT.
2139+
* @NL80211_ATTR_PORT_AUTHORIZED: flag attribute used in %NL80211_CMD_ROAMED
2140+
* notification indicating that that 802.1X authentication was done by
2141+
* the driver or is not needed (because roaming used the Fast Transition
2142+
* protocol).
21332143
*
21342144
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
21352145
* @NL80211_ATTR_MAX: highest attribute number currently defined
@@ -2555,6 +2565,7 @@ enum nl80211_attrs {
25552565

25562566
NL80211_ATTR_WANT_1X_4WAY_HS,
25572567
NL80211_ATTR_PMKR0_NAME,
2568+
NL80211_ATTR_PORT_AUTHORIZED,
25582569

25592570
/* add attributes here, update the policy in nl80211.c */
25602571

‎net/wireless/nl80211.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13800,7 +13800,9 @@ void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
1380013800
info->req_ie)) ||
1380113801
(info->resp_ie &&
1380213802
nla_put(msg, NL80211_ATTR_RESP_IE, info->resp_ie_len,
13803-
info->resp_ie)))
13803+
info->resp_ie)) ||
13804+
(info->authorized &&
13805+
nla_put_flag(msg, NL80211_ATTR_PORT_AUTHORIZED)))
1380413806
goto nla_put_failure;
1380513807

1380613808
genlmsg_end(msg, hdr);

‎net/wireless/sme.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,7 @@ void cfg80211_roamed(struct net_device *dev, struct cfg80211_roam_info *info,
960960
ev->rm.resp_ie_len = info->resp_ie_len;
961961
memcpy((void *)ev->rm.resp_ie, info->resp_ie, info->resp_ie_len);
962962
ev->rm.bss = info->bss;
963+
ev->rm.authorized = info->authorized;
963964

964965
spin_lock_irqsave(&wdev->event_lock, flags);
965966
list_add_tail(&ev->list, &wdev->event_list);

0 commit comments

Comments
 (0)