From f11b0f0eb2ea7562db63a01c60d398ec52d5ea46 Mon Sep 17 00:00:00 2001 From: Zhu Yi Date: Wed, 9 May 2007 13:41:52 +0800 Subject: [PATCH] mac80211: fail back to use associate from reassociate Some APs have strict checking between associate and reassociate. In a case when an AP is restarted during a connection, it denies the mac80211 reassoc request since this is a new association for the AP. To fix this problem, we need to check the status code against WLAN_STATUS_REASSOC_NO_ASSOC and clear ifsta->prev_bssid_set in handling the association failure response. Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- net/mac80211/ieee80211_sta.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index 3e07e9d6fa42..dbac8583f394 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c @@ -1155,6 +1155,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev, if (status_code != WLAN_STATUS_SUCCESS) { printk(KERN_DEBUG "%s: AP denied association (code=%d)\n", dev->name, status_code); + if (status_code == WLAN_STATUS_REASSOC_NO_ASSOC) + ifsta->prev_bssid_set = 0; return; } -- cgit v1.2.3 From e8fdeca241e17dcc5b8f2465be8e1a6347c62fb9 Mon Sep 17 00:00:00 2001 From: Hong Liu Date: Thu, 17 May 2007 11:13:44 +0800 Subject: [PATCH] mac80211: fix memory leak when defrag fragments We forget to free all the fragments when defraging them into one packet. Signed-off-by: Hong Liu Signed-off-by: John W. Linville --- net/mac80211/ieee80211.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index 6e36df67f8d5..145604abd08e 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c @@ -3278,8 +3278,10 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx) return TXRX_DROP; } } - while ((skb = __skb_dequeue(&entry->skb_list))) + while ((skb = __skb_dequeue(&entry->skb_list))) { memcpy(skb_put(rx->skb, skb->len), skb->data, skb->len); + dev_kfree_skb(skb); + } /* Complete frame has been reassembled - process it now */ rx->fragmented = 1; -- cgit v1.2.3 From 52fb24cd83bdd6a1dcbd4cf4b3f5cafb741b5552 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Sun, 20 May 2007 09:44:00 -0700 Subject: [PATCH] mac80211: always set carrier status on open ieee80211_open should always set the carrier status since we may have set it to off before. Signed-off-by: Michael Wu Signed-off-by: John W. Linville --- net/mac80211/ieee80211.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index 145604abd08e..4e84f24fd439 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c @@ -2474,6 +2474,8 @@ static int ieee80211_open(struct net_device *dev) if (sdata->type == IEEE80211_IF_TYPE_STA && !local->user_space_mlme) netif_carrier_off(dev); + else + netif_carrier_on(dev); netif_start_queue(dev); return 0; -- cgit v1.2.3 From 91fa558ba28b0014205f2c1a75b1cceb4298aa04 Mon Sep 17 00:00:00 2001 From: "John W. Linville" Date: Tue, 15 May 2007 16:14:40 -0400 Subject: [PATCH] mac80211: avoid null ptr deref in ieee80211_ibss_add_sta avoid sdata null pointer dereference in ieee80211_ibss_add_sta. Signed-off-by: John W. Linville --- net/mac80211/ieee80211_sta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index dbac8583f394..9f30ae4c2ab3 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c @@ -2997,7 +2997,7 @@ struct sta_info * ieee80211_ibss_add_sta(struct net_device *dev, { struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); struct sta_info *sta; - struct ieee80211_sub_if_data *sdata = NULL; + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); /* TODO: Could consider removing the least recently used entry and * allow new one to be added. */ -- cgit v1.2.3