Skip to content

Commit

Permalink
nl80211: add authorized flag to CONNECT event
Browse files Browse the repository at this point in the history
Add authorized flag to CONNECT event. It is used for 802.1X 4-way
handshake offload with PMK caching.

Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
  • Loading branch information
Chung-Hsien Hsu authored and RobertCNelson committed Oct 9, 2019
1 parent d05356b commit 32c518c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/net/cfg80211.h
Expand Up @@ -5287,6 +5287,8 @@ static inline void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp)
* not known. This value is used only if @status < 0 to indicate that the
* failure is due to a timeout and not due to explicit rejection by the AP.
* This value is ignored in other cases (@status >= 0).
* @authorized: Indicates whether the connection is ready to transport
* data packets.
*/
struct cfg80211_connect_resp_params {
int status;
Expand All @@ -5304,6 +5306,7 @@ struct cfg80211_connect_resp_params {
size_t pmk_len;
const u8 *pmkid;
enum nl80211_timeout_reason timeout_reason;
bool authorized;
};

/**
Expand Down
2 changes: 2 additions & 0 deletions net/wireless/nl80211.c
Expand Up @@ -13782,6 +13782,8 @@ void nl80211_send_connect_result(struct cfg80211_registered_device *rdev,
(nla_put_flag(msg, NL80211_ATTR_TIMED_OUT) ||
nla_put_u32(msg, NL80211_ATTR_TIMEOUT_REASON,
cr->timeout_reason))) ||
(cr->authorized &&
nla_put_flag(msg, NL80211_ATTR_PORT_AUTHORIZED)) ||
(cr->req_ie &&
nla_put(msg, NL80211_ATTR_REQ_IE, cr->req_ie_len, cr->req_ie)) ||
(cr->resp_ie &&
Expand Down
1 change: 1 addition & 0 deletions net/wireless/sme.c
Expand Up @@ -857,6 +857,7 @@ void cfg80211_connect_done(struct net_device *dev,
ev->cr.bss = params->bss;
ev->cr.status = params->status;
ev->cr.timeout_reason = params->timeout_reason;
ev->cr.authorized = params->authorized;

spin_lock_irqsave(&wdev->event_lock, flags);
list_add_tail(&ev->list, &wdev->event_list);
Expand Down

0 comments on commit 32c518c

Please sign in to comment.