Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225326
b: refs/heads/master
c: cf4e594
h: refs/heads/master
v: v3
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Dec 16, 2010
1 parent 6cb42a3 commit 0771856
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5928b91acae97622a6f2e679eb7a9f19bed68e3e
refs/heads/master: cf4e594ea7e55555e81647b74a3a8e8b2826a529
10 changes: 10 additions & 0 deletions trunk/include/linux/nl80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,13 @@
* @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the
* network is determined by the network interface.
*
* @NL80211_CMD_UNPROT_DEAUTHENTICATE: Unprotected deauthentication frame
* notification. This event is used to indicate that an unprotected
* deauthentication frame was dropped when MFP is in use.
* @NL80211_CMD_UNPROT_DISASSOCIATE: Unprotected disassociation frame
* notification. This event is used to indicate that an unprotected
* disassociation frame was dropped when MFP is in use.
*
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
Expand Down Expand Up @@ -508,6 +515,9 @@ enum nl80211_commands {
NL80211_CMD_JOIN_MESH,
NL80211_CMD_LEAVE_MESH,

NL80211_CMD_UNPROT_DEAUTHENTICATE,
NL80211_CMD_UNPROT_DISASSOCIATE,

/* add new commands above here */

/* used to define NL80211_CMD_MAX below */
Expand Down
26 changes: 26 additions & 0 deletions trunk/include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2359,6 +2359,32 @@ void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len);
void __cfg80211_send_disassoc(struct net_device *dev, const u8 *buf,
size_t len);

/**
* cfg80211_send_unprot_deauth - notification of unprotected deauthentication
* @dev: network device
* @buf: deauthentication frame (header + body)
* @len: length of the frame data
*
* This function is called whenever a received Deauthentication frame has been
* dropped in station mode because of MFP being used but the Deauthentication
* frame was not protected. This function may sleep.
*/
void cfg80211_send_unprot_deauth(struct net_device *dev, const u8 *buf,
size_t len);

/**
* cfg80211_send_unprot_disassoc - notification of unprotected disassociation
* @dev: network device
* @buf: disassociation frame (header + body)
* @len: length of the frame data
*
* This function is called whenever a received Disassociation frame has been
* dropped in station mode because of MFP being used but the Disassociation
* frame was not protected. This function may sleep.
*/
void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf,
size_t len);

/**
* cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP)
* @dev: network device
Expand Down
22 changes: 20 additions & 2 deletions trunk/net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1540,12 +1540,30 @@ ieee80211_drop_unencrypted_mgmt(struct ieee80211_rx_data *rx)
if (rx->sta && test_sta_flags(rx->sta, WLAN_STA_MFP)) {
if (unlikely(!ieee80211_has_protected(fc) &&
ieee80211_is_unicast_robust_mgmt_frame(rx->skb) &&
rx->key))
rx->key)) {
if (ieee80211_is_deauth(fc))
cfg80211_send_unprot_deauth(rx->sdata->dev,
rx->skb->data,
rx->skb->len);
else if (ieee80211_is_disassoc(fc))
cfg80211_send_unprot_disassoc(rx->sdata->dev,
rx->skb->data,
rx->skb->len);
return -EACCES;
}
/* BIP does not use Protected field, so need to check MMIE */
if (unlikely(ieee80211_is_multicast_robust_mgmt_frame(rx->skb) &&
ieee80211_get_mmie_keyidx(rx->skb) < 0))
ieee80211_get_mmie_keyidx(rx->skb) < 0)) {
if (ieee80211_is_deauth(fc))
cfg80211_send_unprot_deauth(rx->sdata->dev,
rx->skb->data,
rx->skb->len);
else if (ieee80211_is_disassoc(fc))
cfg80211_send_unprot_disassoc(rx->sdata->dev,
rx->skb->data,
rx->skb->len);
return -EACCES;
}
/*
* When using MFP, Action frames are not allowed prior to
* having configured keys.
Expand Down
22 changes: 22 additions & 0 deletions trunk/net/wireless/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,28 @@ void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len)
}
EXPORT_SYMBOL(cfg80211_send_disassoc);

void cfg80211_send_unprot_deauth(struct net_device *dev, const u8 *buf,
size_t len)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct wiphy *wiphy = wdev->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);

nl80211_send_unprot_deauth(rdev, dev, buf, len, GFP_ATOMIC);
}
EXPORT_SYMBOL(cfg80211_send_unprot_deauth);

void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf,
size_t len)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct wiphy *wiphy = wdev->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);

nl80211_send_unprot_disassoc(rdev, dev, buf, len, GFP_ATOMIC);
}
EXPORT_SYMBOL(cfg80211_send_unprot_disassoc);

static void __cfg80211_auth_remove(struct wireless_dev *wdev, const u8 *addr)
{
int i;
Expand Down
16 changes: 16 additions & 0 deletions trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -5473,6 +5473,22 @@ void nl80211_send_disassoc(struct cfg80211_registered_device *rdev,
NL80211_CMD_DISASSOCIATE, gfp);
}

void nl80211_send_unprot_deauth(struct cfg80211_registered_device *rdev,
struct net_device *netdev, const u8 *buf,
size_t len, gfp_t gfp)
{
nl80211_send_mlme_event(rdev, netdev, buf, len,
NL80211_CMD_UNPROT_DEAUTHENTICATE, gfp);
}

void nl80211_send_unprot_disassoc(struct cfg80211_registered_device *rdev,
struct net_device *netdev, const u8 *buf,
size_t len, gfp_t gfp)
{
nl80211_send_mlme_event(rdev, netdev, buf, len,
NL80211_CMD_UNPROT_DISASSOCIATE, gfp);
}

static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev,
struct net_device *netdev, int cmd,
const u8 *addr, gfp_t gfp)
Expand Down
6 changes: 6 additions & 0 deletions trunk/net/wireless/nl80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ void nl80211_send_deauth(struct cfg80211_registered_device *rdev,
void nl80211_send_disassoc(struct cfg80211_registered_device *rdev,
struct net_device *netdev,
const u8 *buf, size_t len, gfp_t gfp);
void nl80211_send_unprot_deauth(struct cfg80211_registered_device *rdev,
struct net_device *netdev,
const u8 *buf, size_t len, gfp_t gfp);
void nl80211_send_unprot_disassoc(struct cfg80211_registered_device *rdev,
struct net_device *netdev,
const u8 *buf, size_t len, gfp_t gfp);
void nl80211_send_auth_timeout(struct cfg80211_registered_device *rdev,
struct net_device *netdev,
const u8 *addr, gfp_t gfp);
Expand Down

0 comments on commit 0771856

Please sign in to comment.