diff options
author | Eliad Peller <eliad@wizery.com> | 2012-06-28 08:03:13 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-07-02 08:47:44 -0400 |
commit | d9b3b28b93812715dcee8e4eed8cb8d0707a45f8 (patch) | |
tree | e595e36f1d1b4d591d31a4560b26380998d048a1 /net | |
parent | e4e32459c2daea59516da59999706b357e6eb480 (diff) |
mac80211: allow calling ieee80211_ap_probereq_get() during auth/assoc
Drivers might need getting the probe request
(e.g. in order to extract the ssid) even during
auth/assoc.
Make ieee80211_ap_probereq_get() support it
by considering auth_data/assoc_data as well.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/mlme.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 398ce8e9c4d7..e9c0d1b68fc8 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1612,6 +1612,7 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw, | |||
1612 | { | 1612 | { |
1613 | struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); | 1613 | struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); |
1614 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | 1614 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
1615 | struct cfg80211_bss *cbss; | ||
1615 | struct sk_buff *skb; | 1616 | struct sk_buff *skb; |
1616 | const u8 *ssid; | 1617 | const u8 *ssid; |
1617 | int ssid_len; | 1618 | int ssid_len; |
@@ -1621,16 +1622,22 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw, | |||
1621 | 1622 | ||
1622 | ASSERT_MGD_MTX(ifmgd); | 1623 | ASSERT_MGD_MTX(ifmgd); |
1623 | 1624 | ||
1624 | if (!ifmgd->associated) | 1625 | if (ifmgd->associated) |
1626 | cbss = ifmgd->associated; | ||
1627 | else if (ifmgd->auth_data) | ||
1628 | cbss = ifmgd->auth_data->bss; | ||
1629 | else if (ifmgd->assoc_data) | ||
1630 | cbss = ifmgd->assoc_data->bss; | ||
1631 | else | ||
1625 | return NULL; | 1632 | return NULL; |
1626 | 1633 | ||
1627 | ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID); | 1634 | ssid = ieee80211_bss_get_ie(cbss, WLAN_EID_SSID); |
1628 | if (WARN_ON_ONCE(ssid == NULL)) | 1635 | if (WARN_ON_ONCE(ssid == NULL)) |
1629 | ssid_len = 0; | 1636 | ssid_len = 0; |
1630 | else | 1637 | else |
1631 | ssid_len = ssid[1]; | 1638 | ssid_len = ssid[1]; |
1632 | 1639 | ||
1633 | skb = ieee80211_build_probe_req(sdata, ifmgd->associated->bssid, | 1640 | skb = ieee80211_build_probe_req(sdata, cbss->bssid, |
1634 | (u32) -1, ssid + 2, ssid_len, | 1641 | (u32) -1, ssid + 2, ssid_len, |
1635 | NULL, 0, true); | 1642 | NULL, 0, true); |
1636 | 1643 | ||