@@ -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
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(-)