* [PATCH] mac80211: inform userspace of probe/auth/assoc timeout
@ 2008-10-16 19:44 Johannes Berg
2008-10-19 6:01 ` Kalle Valo
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2008-10-16 19:44 UTC (permalink / raw)
To: John Linville; +Cc: Dan Williams, Jouni Malinen, linux-wireless
I noticed that when for some reason [1] the probe or auth times
out, wpa_supplicant doesn't realise this and only tries the next
AP when it runs into its own timeout, which is ten seconds, and
that's quite long. Fix this by making mac80211 notify userspace
that it didn't associate.
[1] my wrt350n in mixed B/G/HT mode often runs into this, maybe
it's because one of the antennas is broken off and for whatever
reason it decides to use that antenna to transmit the response
frames (auth, probe); I do see beacons fine so it's not totally
broken. Works fine in pure-G mode.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
Might be worth backporting to stable?
net/mac80211/mlme.c | 3 +++
1 file changed, 3 insertions(+)
--- everything.orig/net/mac80211/mlme.c 2008-10-16 20:30:06.000000000 +0200
+++ everything/net/mac80211/mlme.c 2008-10-16 21:40:58.000000000 +0200
@@ -763,6 +763,7 @@ static void ieee80211_direct_probe(struc
printk(KERN_DEBUG "%s: direct probe to AP %s timed out\n",
sdata->dev->name, print_mac(mac, ifsta->bssid));
ifsta->state = IEEE80211_STA_MLME_DISABLED;
+ ieee80211_sta_send_apinfo(sdata, ifsta);
return;
}
@@ -795,6 +796,7 @@ static void ieee80211_authenticate(struc
" timed out\n",
sdata->dev->name, print_mac(mac, ifsta->bssid));
ifsta->state = IEEE80211_STA_MLME_DISABLED;
+ ieee80211_sta_send_apinfo(sdata, ifsta);
return;
}
@@ -917,6 +919,7 @@ static void ieee80211_associate(struct i
" timed out\n",
sdata->dev->name, print_mac(mac, ifsta->bssid));
ifsta->state = IEEE80211_STA_MLME_DISABLED;
+ ieee80211_sta_send_apinfo(sdata, ifsta);
return;
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211: inform userspace of probe/auth/assoc timeout
2008-10-16 19:44 [PATCH] mac80211: inform userspace of probe/auth/assoc timeout Johannes Berg
@ 2008-10-19 6:01 ` Kalle Valo
2008-10-19 10:16 ` Johannes Berg
2008-10-19 19:18 ` Kalle Valo
0 siblings, 2 replies; 5+ messages in thread
From: Kalle Valo @ 2008-10-19 6:01 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, Dan Williams, Jouni Malinen, linux-wireless
Johannes Berg <johannes@sipsolutions.net> writes:
> I noticed that when for some reason [1] the probe or auth times
> out, wpa_supplicant doesn't realise this and only tries the next
> AP when it runs into its own timeout, which is ten seconds, and
> that's quite long. Fix this by making mac80211 notify userspace
> that it didn't associate.
Earlier this week I received an internal bug report about this.
Excellent timing for providing a fix. Thank you, Johannes :)
> Might be worth backporting to stable?
I have to backport the patch anyway so I can provide the patch. But I
don't think this being that important bug to be fixed in stable
series. We have had this bug in mac80211 always, right?
--
Kalle Valo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211: inform userspace of probe/auth/assoc timeout
2008-10-19 6:01 ` Kalle Valo
@ 2008-10-19 10:16 ` Johannes Berg
2008-10-19 19:18 ` Kalle Valo
1 sibling, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2008-10-19 10:16 UTC (permalink / raw)
To: Kalle Valo; +Cc: John Linville, Dan Williams, Jouni Malinen, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 958 bytes --]
On Sun, 2008-10-19 at 09:01 +0300, Kalle Valo wrote:
> Johannes Berg <johannes@sipsolutions.net> writes:
>
> > I noticed that when for some reason [1] the probe or auth times
> > out, wpa_supplicant doesn't realise this and only tries the next
> > AP when it runs into its own timeout, which is ten seconds, and
> > that's quite long. Fix this by making mac80211 notify userspace
> > that it didn't associate.
>
> Earlier this week I received an internal bug report about this.
> Excellent timing for providing a fix. Thank you, Johannes :)
Heh :)
> > Might be worth backporting to stable?
>
> I have to backport the patch anyway so I can provide the patch. But I
> don't think this being that important bug to be fixed in stable
> series. We have had this bug in mac80211 always, right?
I'm not entirely sure, I haven't dug through, it might have been
introduced only with one of the refactorings this code has seen.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] mac80211: inform userspace of probe/auth/assoc timeout
2008-10-19 6:01 ` Kalle Valo
2008-10-19 10:16 ` Johannes Berg
@ 2008-10-19 19:18 ` Kalle Valo
2008-10-19 21:35 ` Tomas Winkler
1 sibling, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2008-10-19 19:18 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
From: Johannes Berg <johannes@sipsolutions.net>
I noticed that when for some reason [1] the probe or auth times
out, wpa_supplicant doesn't realise this and only tries the next
AP when it runs into its own timeout, which is ten seconds, and
that's quite long. Fix this by making mac80211 notify userspace
that it didn't associate.
[1] my wrt350n in mixed B/G/HT mode often runs into this, maybe
it's because one of the antennas is broken off and for whatever
reason it decides to use that antenna to transmit the response
frames (auth, probe); I do see beacons fine so it's not totally
broken. Works fine in pure-G mode.
kvalo: backported to 2.6.27
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
---
Here's a backport of Johannes' patch for 2.6.27 in case anyone
considers this for stable releases.
net/mac80211/mlme.c | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 902cac1..ca80acd 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -475,6 +475,17 @@ int ieee80211_ht_addt_info_ie_to_ht_bss_info(
return 0;
}
+static void ieee80211_sta_send_apinfo(struct ieee80211_sub_if_data *sdata,
+ struct ieee80211_if_sta *ifsta)
+{
+ union iwreq_data wrqu;
+ memset(&wrqu, 0, sizeof(wrqu));
+ if (ifsta->flags & IEEE80211_STA_ASSOCIATED)
+ memcpy(wrqu.ap_addr.sa_data, sdata->u.sta.bssid, ETH_ALEN);
+ wrqu.ap_addr.sa_family = ARPHRD_ETHER;
+ wireless_send_event(sdata->dev, SIOCGIWAP, &wrqu, NULL);
+}
+
static void ieee80211_sta_send_associnfo(struct net_device *dev,
struct ieee80211_if_sta *ifsta)
{
@@ -533,7 +544,6 @@ static void ieee80211_set_associated(struct net_device *dev,
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = sdata->local;
struct ieee80211_conf *conf = &local_to_hw(local)->conf;
- union iwreq_data wrqu;
u32 changed = BSS_CHANGED_ASSOC;
if (assoc) {
@@ -567,7 +577,6 @@ static void ieee80211_set_associated(struct net_device *dev,
ifsta->flags |= IEEE80211_STA_PREV_BSSID_SET;
memcpy(ifsta->prev_bssid, sdata->u.sta.bssid, ETH_ALEN);
- memcpy(wrqu.ap_addr.sa_data, sdata->u.sta.bssid, ETH_ALEN);
ieee80211_sta_send_associnfo(dev, ifsta);
} else {
netif_carrier_off(dev);
@@ -578,8 +587,6 @@ static void ieee80211_set_associated(struct net_device *dev,
sdata->bss_conf.assoc_ht = 0;
sdata->bss_conf.ht_conf = NULL;
sdata->bss_conf.ht_bss_conf = NULL;
-
- memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
}
ifsta->last_probe = jiffies;
ieee80211_led_assoc(local, assoc);
@@ -590,8 +597,7 @@ static void ieee80211_set_associated(struct net_device *dev,
if (assoc)
netif_carrier_on(dev);
- wrqu.ap_addr.sa_family = ARPHRD_ETHER;
- wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
+ ieee80211_sta_send_apinfo(sdata, ifsta);
}
static void ieee80211_set_disassoc(struct net_device *dev,
@@ -662,6 +668,7 @@ static void ieee80211_send_auth(struct net_device *dev,
static void ieee80211_authenticate(struct net_device *dev,
struct ieee80211_if_sta *ifsta)
{
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
DECLARE_MAC_BUF(mac);
ifsta->auth_tries++;
@@ -670,6 +677,7 @@ static void ieee80211_authenticate(struct net_device *dev,
" timed out\n",
dev->name, print_mac(mac, ifsta->bssid));
ifsta->state = IEEE80211_DISABLED;
+ ieee80211_sta_send_apinfo(sdata, ifsta);
return;
}
@@ -1003,6 +1011,7 @@ static int ieee80211_privacy_mismatch(struct net_device *dev,
static void ieee80211_associate(struct net_device *dev,
struct ieee80211_if_sta *ifsta)
{
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
DECLARE_MAC_BUF(mac);
ifsta->assoc_tries++;
@@ -1011,6 +1020,7 @@ static void ieee80211_associate(struct net_device *dev,
" timed out\n",
dev->name, print_mac(mac, ifsta->bssid));
ifsta->state = IEEE80211_DISABLED;
+ ieee80211_sta_send_apinfo(sdata, ifsta);
return;
}
@@ -1021,6 +1031,7 @@ static void ieee80211_associate(struct net_device *dev,
printk(KERN_DEBUG "%s: mismatch in privacy configuration and "
"mixed-cell disabled - abort association\n", dev->name);
ifsta->state = IEEE80211_DISABLED;
+ ieee80211_sta_send_apinfo(sdata, ifsta);
return;
}
--
1.5.6.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211: inform userspace of probe/auth/assoc timeout
2008-10-19 19:18 ` Kalle Valo
@ 2008-10-19 21:35 ` Tomas Winkler
0 siblings, 0 replies; 5+ messages in thread
From: Tomas Winkler @ 2008-10-19 21:35 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Johannes Berg
On Sun, Oct 19, 2008 at 9:18 PM, Kalle Valo <kalle.valo@nokia.com> wrote:
> From: Johannes Berg <johannes@sipsolutions.net>
>
> I noticed that when for some reason [1] the probe or auth times
> out, wpa_supplicant doesn't realise this and only tries the next
> AP when it runs into its own timeout, which is ten seconds, and
> that's quite long. Fix this by making mac80211 notify userspace
> that it didn't associate.
>
> [1] my wrt350n in mixed B/G/HT mode often runs into this, maybe
> it's because one of the antennas is broken off and for whatever
> reason it decides to use that antenna to transmit the response
> frames (auth, probe); I do see beacons fine so it's not totally
> broken. Works fine in pure-G mode.
>
> kvalo: backported to 2.6.27
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
> ---
>
> Here's a backport of Johannes' patch for 2.6.27
and one function of mine :)
Ack
Tomas
in case anyone
> considers this for stable releases.
and
> net/mac80211/mlme.c | 23 +++++++++++++++++------
> 1 files changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index 902cac1..ca80acd 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -475,6 +475,17 @@ int ieee80211_ht_addt_info_ie_to_ht_bss_info(
> return 0;
> }
>
> +static void ieee80211_sta_send_apinfo(struct ieee80211_sub_if_data *sdata,
> + struct ieee80211_if_sta *ifsta)
> +{
> + union iwreq_data wrqu;
> + memset(&wrqu, 0, sizeof(wrqu));
> + if (ifsta->flags & IEEE80211_STA_ASSOCIATED)
> + memcpy(wrqu.ap_addr.sa_data, sdata->u.sta.bssid, ETH_ALEN);
> + wrqu.ap_addr.sa_family = ARPHRD_ETHER;
> + wireless_send_event(sdata->dev, SIOCGIWAP, &wrqu, NULL);
> +}
> +
> static void ieee80211_sta_send_associnfo(struct net_device *dev,
> struct ieee80211_if_sta *ifsta)
> {
> @@ -533,7 +544,6 @@ static void ieee80211_set_associated(struct net_device *dev,
> struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> struct ieee80211_local *local = sdata->local;
> struct ieee80211_conf *conf = &local_to_hw(local)->conf;
> - union iwreq_data wrqu;
> u32 changed = BSS_CHANGED_ASSOC;
>
> if (assoc) {
> @@ -567,7 +577,6 @@ static void ieee80211_set_associated(struct net_device *dev,
>
> ifsta->flags |= IEEE80211_STA_PREV_BSSID_SET;
> memcpy(ifsta->prev_bssid, sdata->u.sta.bssid, ETH_ALEN);
> - memcpy(wrqu.ap_addr.sa_data, sdata->u.sta.bssid, ETH_ALEN);
> ieee80211_sta_send_associnfo(dev, ifsta);
> } else {
> netif_carrier_off(dev);
> @@ -578,8 +587,6 @@ static void ieee80211_set_associated(struct net_device *dev,
> sdata->bss_conf.assoc_ht = 0;
> sdata->bss_conf.ht_conf = NULL;
> sdata->bss_conf.ht_bss_conf = NULL;
> -
> - memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
> }
> ifsta->last_probe = jiffies;
> ieee80211_led_assoc(local, assoc);
> @@ -590,8 +597,7 @@ static void ieee80211_set_associated(struct net_device *dev,
> if (assoc)
> netif_carrier_on(dev);
>
> - wrqu.ap_addr.sa_family = ARPHRD_ETHER;
> - wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
> + ieee80211_sta_send_apinfo(sdata, ifsta);
> }
>
> static void ieee80211_set_disassoc(struct net_device *dev,
> @@ -662,6 +668,7 @@ static void ieee80211_send_auth(struct net_device *dev,
> static void ieee80211_authenticate(struct net_device *dev,
> struct ieee80211_if_sta *ifsta)
> {
> + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> DECLARE_MAC_BUF(mac);
>
> ifsta->auth_tries++;
> @@ -670,6 +677,7 @@ static void ieee80211_authenticate(struct net_device *dev,
> " timed out\n",
> dev->name, print_mac(mac, ifsta->bssid));
> ifsta->state = IEEE80211_DISABLED;
> + ieee80211_sta_send_apinfo(sdata, ifsta);
> return;
> }
>
> @@ -1003,6 +1011,7 @@ static int ieee80211_privacy_mismatch(struct net_device *dev,
> static void ieee80211_associate(struct net_device *dev,
> struct ieee80211_if_sta *ifsta)
> {
> + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> DECLARE_MAC_BUF(mac);
>
> ifsta->assoc_tries++;
> @@ -1011,6 +1020,7 @@ static void ieee80211_associate(struct net_device *dev,
> " timed out\n",
> dev->name, print_mac(mac, ifsta->bssid));
> ifsta->state = IEEE80211_DISABLED;
> + ieee80211_sta_send_apinfo(sdata, ifsta);
> return;
> }
>
> @@ -1021,6 +1031,7 @@ static void ieee80211_associate(struct net_device *dev,
> printk(KERN_DEBUG "%s: mismatch in privacy configuration and "
> "mixed-cell disabled - abort association\n", dev->name);
> ifsta->state = IEEE80211_DISABLED;
> + ieee80211_sta_send_apinfo(sdata, ifsta);
> return;
> }
>
> --
> 1.5.6.5
>
> --
> 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-10-19 21:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-16 19:44 [PATCH] mac80211: inform userspace of probe/auth/assoc timeout Johannes Berg
2008-10-19 6:01 ` Kalle Valo
2008-10-19 10:16 ` Johannes Berg
2008-10-19 19:18 ` Kalle Valo
2008-10-19 21:35 ` Tomas Winkler
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.