Commit 6abe0563 authored by Will Hawkins's avatar Will Hawkins Committed by Johannes Berg

mac80211: Track auth frame registrations on IBSS ifaces

Track userspace registrations for authentication
frames received on an IBSS interface. This field
will be used to decide whether or not to send
"open system" authentication frames when a new
station joins an adhoc network.
Signed-off-by: default avatarWill Hawkins <hawkinsw@opentechinstitute.org>
[redesign the code flow a bit]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 9ea4fa15
...@@ -2516,16 +2516,30 @@ static void ieee80211_mgmt_frame_register(struct wiphy *wiphy, ...@@ -2516,16 +2516,30 @@ static void ieee80211_mgmt_frame_register(struct wiphy *wiphy,
u16 frame_type, bool reg) u16 frame_type, bool reg)
{ {
struct ieee80211_local *local = wiphy_priv(wiphy); struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
if (frame_type != (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ)) switch (frame_type) {
return; case IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH:
if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
if (reg) if (reg)
local->probe_req_reg++; ifibss->auth_frame_registrations++;
else else
local->probe_req_reg--; ifibss->auth_frame_registrations--;
}
break;
case IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ:
if (reg)
local->probe_req_reg++;
else
local->probe_req_reg--;
ieee80211_queue_work(&local->hw, &local->reconfig_filter); ieee80211_queue_work(&local->hw, &local->reconfig_filter);
break;
default:
break;
}
} }
static int ieee80211_set_antenna(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant) static int ieee80211_set_antenna(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant)
......
...@@ -511,6 +511,7 @@ struct ieee80211_if_ibss { ...@@ -511,6 +511,7 @@ struct ieee80211_if_ibss {
bool privacy; bool privacy;
bool control_port; bool control_port;
unsigned int auth_frame_registrations;
u8 bssid[ETH_ALEN] __aligned(2); u8 bssid[ETH_ALEN] __aligned(2);
u8 ssid[IEEE80211_MAX_SSID_LEN]; u8 ssid[IEEE80211_MAX_SSID_LEN];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment