Whenever we get an AUTH frame we first allocate a new station and then we reply
with another AUTH frame. However, if sta allocations fails we have to do not
reply so that the other hand do not think we have correctly set everything up
Signed-off-by: Antonio Quartulli <[email protected]>
---
net/mac80211/ibss.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 5746d62..37e71a3 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -337,6 +337,7 @@ static void ieee80211_rx_mgmt_auth_ibss(struct ieee80211_sub_if_data *sdata,
size_t len)
{
u16 auth_alg, auth_transaction;
+ struct sta_info *sta;
lockdep_assert_held(&sdata->u.ibss.mtx);
@@ -352,10 +353,17 @@ static void ieee80211_rx_mgmt_auth_ibss(struct ieee80211_sub_if_data *sdata,
"RX Auth SA=%pM DA=%pM BSSID=%pM (auth_transaction=%d)\n",
mgmt->sa, mgmt->da, mgmt->bssid, auth_transaction);
sta_info_destroy_addr(sdata, mgmt->sa);
- ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, 0, false);
+ sta = ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, 0, false);
rcu_read_unlock();
/*
+ * if we have any problem in allocating the new station, we do not reply
+ * with the AUTH frame
+ */
+ if (!sta)
+ return;
+
+ /*
* IEEE 802.11 standard does not require authentication in IBSS
* networks and most implementations do not seem to use it.
* However, try to reply to authentication attempts if someone
--
1.7.9.4
On Wed, 2012-08-08 at 21:34 +0200, Antonio Quartulli wrote:
> Whenever we get an AUTH frame we first allocate a new station and then we reply
> with another AUTH frame. However, if sta allocations fails we have to do not
> reply so that the other hand do not think we have correctly set everything up
Maybe we should send a negative auth reply instead since there's no
guarantee that any station will ever send a reply at all?
johannes