diff mbox

mac80211: do not reply to AUTH frame if sta allocation fails

Message ID 1344454452-19480-1-git-send-email-ordex@autistici.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Antonio Quartulli Aug. 8, 2012, 7:34 p.m. UTC
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 <ordex@autistici.org>
---
 net/mac80211/ibss.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Johannes Berg Aug. 20, 2012, 11:22 a.m. UTC | #1
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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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