- Ensure the supplicant starts and ends with clean driver state
- Handle driver disconnect spammage by forcibly clearing SSID - Don't switch access points unless the current association is dire (rh #493745)
This commit is contained in:
parent
cff725b80d
commit
184c33502b
333
wpa_supplicant-0.6.8-ap-stability.patch
Normal file
333
wpa_supplicant-0.6.8-ap-stability.patch
Normal file
@ -0,0 +1,333 @@
|
||||
diff -up wpa_supplicant-0.6.8/src/drivers/driver.h.ap-stability wpa_supplicant-0.6.8/src/drivers/driver.h
|
||||
--- wpa_supplicant-0.6.8/src/drivers/driver.h.ap-stability 2009-02-15 13:00:00.000000000 -0500
|
||||
+++ wpa_supplicant-0.6.8/src/drivers/driver.h 2009-05-12 16:01:32.000000000 -0400
|
||||
@@ -1017,6 +1017,21 @@ struct wpa_driver_ops {
|
||||
* failure
|
||||
*/
|
||||
struct wpa_interface_info * (*get_interfaces)(void *global_priv);
|
||||
+
|
||||
+ /**
|
||||
+ * get_signal_quality - Request signal quality of the current association
|
||||
+ * @priv: private driver interface data
|
||||
+ * @qual: signal "quality", perhaps including TX errors, missed beacons,
|
||||
+ * etc. If not provided, set to 0.
|
||||
+ * @max_qual: maximum possible signal quality. If not provided set to 0.
|
||||
+ *
|
||||
+ * This handler may be called at any time to retrieve the signal quality
|
||||
+ * of the current association. If there is no association, the handler
|
||||
+ * must return -1. If the signal level isn't known or is not provided,
|
||||
+ * the handler must return -1.
|
||||
+ * Returns: 0 on success, -1 on failure
|
||||
+ */
|
||||
+ int (*get_signal_quality)(void *priv, int *qual, int *max_qual);
|
||||
};
|
||||
|
||||
/* Function to check whether a driver is for wired connections */
|
||||
diff -up wpa_supplicant-0.6.8/src/drivers/driver_wext.c.ap-stability wpa_supplicant-0.6.8/src/drivers/driver_wext.c
|
||||
--- wpa_supplicant-0.6.8/src/drivers/driver_wext.c.ap-stability 2009-05-12 16:01:32.000000000 -0400
|
||||
+++ wpa_supplicant-0.6.8/src/drivers/driver_wext.c 2009-05-12 16:01:32.000000000 -0400
|
||||
@@ -1615,6 +1615,10 @@ static int wpa_driver_wext_get_range(voi
|
||||
if (range->enc_capa & IW_ENC_CAPA_4WAY_HANDSHAKE)
|
||||
drv->capa.flags |= WPA_DRIVER_FLAGS_4WAY_HANDSHAKE;
|
||||
|
||||
+ drv->max_qual.qual = range->max_qual.qual;
|
||||
+ drv->max_qual.level = range->max_qual.level;
|
||||
+ drv->max_qual.updated = range->max_qual.updated;
|
||||
+
|
||||
wpa_printf(MSG_DEBUG, " capabilities: key_mgmt 0x%x enc 0x%x "
|
||||
"flags 0x%x",
|
||||
drv->capa.key_mgmt, drv->capa.enc, drv->capa.flags);
|
||||
@@ -2244,6 +2248,51 @@ done:
|
||||
}
|
||||
|
||||
|
||||
+/**
|
||||
+ * wpa_driver_wext_get_signal_quality - Get wireless signal quality, SIOCSIWSTATS
|
||||
+ * @priv: Pointer to private wext data from wpa_driver_wext_init()
|
||||
+ * @qual: signal quality
|
||||
+ * @max_qual: maximum signal quality
|
||||
+ * Returns: 0 on success, -1 on failure
|
||||
+ */
|
||||
+int wpa_driver_wext_get_signal_quality(void *priv, int *qual, int *max_qual)
|
||||
+{
|
||||
+ struct wpa_driver_wext_data *drv = priv;
|
||||
+ struct iwreq iwr;
|
||||
+ struct iw_statistics stats;
|
||||
+ s8 level = 0;
|
||||
+
|
||||
+ os_memset(&iwr, 0, sizeof(iwr));
|
||||
+ os_strlcpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
|
||||
+
|
||||
+ memset (&stats, 0, sizeof (stats));
|
||||
+ iwr.u.data.pointer = &stats;
|
||||
+ iwr.u.data.length = sizeof (stats);
|
||||
+ iwr.u.data.flags = 1; /* Clear updated flag */
|
||||
+
|
||||
+ if (ioctl(drv->ioctl_sock, SIOCGIWSTATS, &iwr)) {
|
||||
+ wpa_printf(MSG_DEBUG, "%s: IWSTATS returned error: %d",
|
||||
+ __FUNCTION__, errno);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if ( !(drv->max_qual.updated & IW_QUAL_LEVEL_INVALID)
|
||||
+ && !(stats.qual.updated & IW_QUAL_LEVEL_INVALID)) {
|
||||
+ level = stats.qual.level;
|
||||
+ }
|
||||
+
|
||||
+ if ( !(drv->max_qual.updated & IW_QUAL_QUAL_INVALID)
|
||||
+ && !(stats.qual.updated & IW_QUAL_QUAL_INVALID)) {
|
||||
+ *qual = stats.qual.qual;
|
||||
+ *max_qual = drv->max_qual.qual;
|
||||
+ }
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "%s: level %d (%d), qual %d (%d)", __FUNCTION__,
|
||||
+ level, drv->max_qual.level, *qual, drv->max_qual.qual);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int wpa_driver_wext_pmksa(struct wpa_driver_wext_data *drv,
|
||||
u32 cmd, const u8 *bssid, const u8 *pmkid)
|
||||
{
|
||||
@@ -2357,6 +2406,7 @@ const struct wpa_driver_ops wpa_driver_w
|
||||
.deauthenticate = wpa_driver_wext_deauthenticate,
|
||||
.disassociate = wpa_driver_wext_disassociate,
|
||||
.set_mode = wpa_driver_wext_set_mode,
|
||||
+ .get_signal_quality = wpa_driver_wext_get_signal_quality,
|
||||
.associate = wpa_driver_wext_associate,
|
||||
.set_auth_alg = wpa_driver_wext_set_auth_alg,
|
||||
.init = wpa_driver_wext_init,
|
||||
diff -up wpa_supplicant-0.6.8/src/drivers/driver_wext.h.ap-stability wpa_supplicant-0.6.8/src/drivers/driver_wext.h
|
||||
--- wpa_supplicant-0.6.8/src/drivers/driver_wext.h.ap-stability 2009-02-15 13:00:00.000000000 -0500
|
||||
+++ wpa_supplicant-0.6.8/src/drivers/driver_wext.h 2009-05-12 16:01:32.000000000 -0400
|
||||
@@ -16,6 +16,7 @@
|
||||
#define DRIVER_WEXT_H
|
||||
|
||||
#include <net/if.h>
|
||||
+#include "wireless.h"
|
||||
|
||||
struct wpa_driver_wext_data {
|
||||
void *ctx;
|
||||
@@ -43,6 +44,8 @@ struct wpa_driver_wext_data {
|
||||
char mlmedev[IFNAMSIZ + 1];
|
||||
|
||||
int scan_complete_events;
|
||||
+
|
||||
+ struct iw_quality max_qual;
|
||||
};
|
||||
|
||||
int wpa_driver_wext_get_ifflags(struct wpa_driver_wext_data *drv, int *flags);
|
||||
diff -up wpa_supplicant-0.6.8/wpa_supplicant/events.c.ap-stability wpa_supplicant-0.6.8/wpa_supplicant/events.c
|
||||
--- wpa_supplicant-0.6.8/wpa_supplicant/events.c.ap-stability 2009-05-12 16:01:32.000000000 -0400
|
||||
+++ wpa_supplicant-0.6.8/wpa_supplicant/events.c 2009-05-12 16:19:06.000000000 -0400
|
||||
@@ -371,9 +371,53 @@ static int wpa_supplicant_ssid_bss_match
|
||||
}
|
||||
|
||||
|
||||
+struct cur_ap {
|
||||
+ u8 bssid[ETH_ALEN];
|
||||
+ int qual;
|
||||
+ int max_qual;
|
||||
+};
|
||||
+
|
||||
+#define CUR_AP_THRESHOLD 50
|
||||
+
|
||||
+/* Return 1 if 'bss' should be used instead of the current association */
|
||||
+static int
|
||||
+bss_better_quality(struct wpa_scan_res *bss, struct cur_ap *cur)
|
||||
+{
|
||||
+ int cur_pqual, bss_pqual;
|
||||
+
|
||||
+ /* If the max quality is invalid, quality is pretty meaningless */
|
||||
+ if (!cur->max_qual) {
|
||||
+ wpa_printf(MSG_DEBUG, " no max quality");
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ cur_pqual = (int) (((float) cur->qual / (float) cur->max_qual) * 100);
|
||||
+ bss_pqual = (int) (((float) bss->qual / (float) cur->max_qual) * 100);
|
||||
+
|
||||
+ /* If 'bss' is the current associated BSS and it's still got OK quality,
|
||||
+ * stick with it.
|
||||
+ */
|
||||
+ if (!os_memcmp(cur->bssid, bss->bssid, ETH_ALEN) && (cur_pqual >= CUR_AP_THRESHOLD)) {
|
||||
+ wpa_printf(MSG_DEBUG, " matched associated BSSID");
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, " cur AP qual: %d candidate qual: %d", cur_pqual, bss_pqual);
|
||||
+
|
||||
+ /* Otherwise if the current association is worse than 50% quality and
|
||||
+ * 'bss' is at least 15% better, then use 'bss'.
|
||||
+ */
|
||||
+ if ((cur_pqual < CUR_AP_THRESHOLD) && (bss_pqual >= cur_pqual + 15))
|
||||
+ return 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static struct wpa_scan_res *
|
||||
wpa_supplicant_select_bss_wpa(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *group,
|
||||
+ struct cur_ap *cur,
|
||||
struct wpa_ssid **selected_ssid)
|
||||
{
|
||||
struct wpa_ssid *ssid;
|
||||
@@ -448,6 +492,12 @@ wpa_supplicant_select_bss_wpa(struct wpa
|
||||
if (!wpa_supplicant_ssid_bss_match(wpa_s, ssid, bss))
|
||||
continue;
|
||||
|
||||
+ if (cur && !bss_better_quality(bss, cur)) {
|
||||
+ wpa_printf(MSG_DEBUG, " skip - "
|
||||
+ "signal strength not high enough");
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
wpa_printf(MSG_DEBUG, " selected WPA AP "
|
||||
MACSTR " ssid='%s'",
|
||||
MAC2STR(bss->bssid),
|
||||
@@ -464,6 +514,7 @@ wpa_supplicant_select_bss_wpa(struct wpa
|
||||
static struct wpa_scan_res *
|
||||
wpa_supplicant_select_bss_non_wpa(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *group,
|
||||
+ struct cur_ap *cur,
|
||||
struct wpa_ssid **selected_ssid)
|
||||
{
|
||||
struct wpa_ssid *ssid;
|
||||
@@ -569,6 +620,12 @@ wpa_supplicant_select_bss_non_wpa(struct
|
||||
continue;
|
||||
}
|
||||
|
||||
+ if (cur && !bss_better_quality(bss, cur)) {
|
||||
+ wpa_printf(MSG_DEBUG, " skip - "
|
||||
+ "signal strength not high enough");
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
wpa_printf(MSG_DEBUG, " selected non-WPA AP "
|
||||
MACSTR " ssid='%s'",
|
||||
MAC2STR(bss->bssid),
|
||||
@@ -584,21 +641,45 @@ wpa_supplicant_select_bss_non_wpa(struct
|
||||
|
||||
static struct wpa_scan_res *
|
||||
wpa_supplicant_select_bss(struct wpa_supplicant *wpa_s, struct wpa_ssid *group,
|
||||
- struct wpa_ssid **selected_ssid)
|
||||
+ struct cur_ap *cur, struct wpa_ssid **selected_ssid)
|
||||
{
|
||||
struct wpa_scan_res *selected;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "Selecting BSS from priority group %d",
|
||||
group->priority);
|
||||
|
||||
+ if (cur) {
|
||||
+ int found = 0, i;
|
||||
+ struct wpa_scan_res *bss;
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "Try to find current BSSID "
|
||||
+ "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
+ cur->bssid[0], cur->bssid[1], cur->bssid[2],
|
||||
+ cur->bssid[3], cur->bssid[4], cur->bssid[5]);
|
||||
+ for (i = 0; i < wpa_s->scan_res->num; i++) {
|
||||
+ bss = wpa_s->scan_res->res[i];
|
||||
+ if (os_memcmp(bss->bssid, cur->bssid, ETH_ALEN) != 0) {
|
||||
+ wpa_printf(MSG_DEBUG, " skip - "
|
||||
+ "BSSID mismatch");
|
||||
+ continue;
|
||||
+ }
|
||||
+ wpa_printf(MSG_DEBUG, " found");
|
||||
+ found = 1;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (!found)
|
||||
+ cur = NULL;
|
||||
+ }
|
||||
+
|
||||
/* First, try to find WPA-enabled AP */
|
||||
- selected = wpa_supplicant_select_bss_wpa(wpa_s, group, selected_ssid);
|
||||
+ selected = wpa_supplicant_select_bss_wpa(wpa_s, group, cur, selected_ssid);
|
||||
if (selected)
|
||||
return selected;
|
||||
|
||||
/* If no WPA-enabled AP found, try to find non-WPA AP, if configuration
|
||||
* allows this. */
|
||||
- return wpa_supplicant_select_bss_non_wpa(wpa_s, group, selected_ssid);
|
||||
+ return wpa_supplicant_select_bss_non_wpa(wpa_s, group, cur, selected_ssid);
|
||||
}
|
||||
|
||||
|
||||
@@ -607,6 +687,8 @@ static void wpa_supplicant_event_scan_re
|
||||
int prio, timeout;
|
||||
struct wpa_scan_res *selected = NULL;
|
||||
struct wpa_ssid *ssid = NULL;
|
||||
+ int qual = 0, max_qual = 0, qual_valid = 0, bssid_valid = 0, i;
|
||||
+ struct cur_ap cur;
|
||||
|
||||
if (wpa_supplicant_get_scan_results(wpa_s) < 0) {
|
||||
if (wpa_s->conf->ap_scan == 2)
|
||||
@@ -635,10 +717,44 @@ static void wpa_supplicant_event_scan_re
|
||||
wpa_s->disconnected)
|
||||
return;
|
||||
|
||||
+ /* Get current driver BSSID and signal strength */
|
||||
+ os_memset(&cur, 0, sizeof(cur));
|
||||
+
|
||||
+ for (i = 0; i < 4; i++) {
|
||||
+ static u8 bad1[ETH_ALEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
+ static u8 bad2[ETH_ALEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
||||
+ static u8 bad3[ETH_ALEN] = {0x44, 0x44, 0x44, 0x44, 0x44, 0x44};
|
||||
+
|
||||
+ if (wpa_drv_get_bssid(wpa_s, (u8 *) &cur.bssid) == 0) {
|
||||
+ if (memcmp(cur.bssid, bad1, ETH_ALEN) &&
|
||||
+ memcmp(cur.bssid, bad2, ETH_ALEN) &&
|
||||
+ memcmp(cur.bssid, bad3, ETH_ALEN)) {
|
||||
+ bssid_valid = 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (bssid_valid) {
|
||||
+ for (i = 0; i < 4; i++) {
|
||||
+ qual_valid = !wpa_drv_get_signal_quality(wpa_s, &qual, &max_qual);
|
||||
+ if (qual_valid && qual) {
|
||||
+ cur.qual = qual;
|
||||
+ cur.max_qual = max_qual;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "%s: qual %d (%d) qv=%d bv=%d",
|
||||
+ __FUNCTION__, qual, max_qual, qual_valid, bssid_valid);
|
||||
+
|
||||
while (selected == NULL) {
|
||||
for (prio = 0; prio < wpa_s->conf->num_prio; prio++) {
|
||||
selected = wpa_supplicant_select_bss(
|
||||
- wpa_s, wpa_s->conf->pssid[prio], &ssid);
|
||||
+ wpa_s, wpa_s->conf->pssid[prio],
|
||||
+ (bssid_valid && qual_valid) ? &cur : NULL,
|
||||
+ &ssid);
|
||||
if (selected)
|
||||
break;
|
||||
}
|
||||
diff -up wpa_supplicant-0.6.8/wpa_supplicant/wpa_supplicant_i.h.ap-stability wpa_supplicant-0.6.8/wpa_supplicant/wpa_supplicant_i.h
|
||||
--- wpa_supplicant-0.6.8/wpa_supplicant/wpa_supplicant_i.h.ap-stability 2009-05-12 16:01:32.000000000 -0400
|
||||
+++ wpa_supplicant-0.6.8/wpa_supplicant/wpa_supplicant_i.h 2009-05-12 16:01:33.000000000 -0400
|
||||
@@ -485,6 +485,15 @@ static inline int wpa_drv_set_mode(struc
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static inline int wpa_drv_get_signal_quality(struct wpa_supplicant *wpa_s,
|
||||
+ int *qual, int *max_qual)
|
||||
+{
|
||||
+ if (wpa_s->driver->get_signal_quality) {
|
||||
+ return wpa_s->driver->get_signal_quality(wpa_s->drv_priv, qual, max_qual);
|
||||
+ }
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
static inline int wpa_drv_associate(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_driver_associate_params *params)
|
||||
{
|
52
wpa_supplicant-0.6.8-disconnect-init-deinit.patch
Normal file
52
wpa_supplicant-0.6.8-disconnect-init-deinit.patch
Normal file
@ -0,0 +1,52 @@
|
||||
diff -up wpa_supplicant-0.6.4/src/drivers/driver_wext.c.disconnect-on-init wpa_supplicant-0.6.4/src/drivers/driver_wext.c
|
||||
--- wpa_supplicant-0.6.4/src/drivers/driver_wext.c.disconnect-on-init 2009-05-12 14:38:30.000000000 -0400
|
||||
+++ wpa_supplicant-0.6.4/src/drivers/driver_wext.c 2009-05-12 15:00:09.000000000 -0400
|
||||
@@ -155,6 +155,7 @@ enum {
|
||||
static int wpa_driver_wext_flush_pmkid(void *priv);
|
||||
static int wpa_driver_wext_get_range(void *priv);
|
||||
static void wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv);
|
||||
+static void wpa_driver_wext_disconnect(struct wpa_driver_wext_data *drv);
|
||||
|
||||
|
||||
static int wpa_driver_wext_send_oper_ifla(struct wpa_driver_wext_data *drv,
|
||||
@@ -1142,6 +1143,12 @@ static void wpa_driver_wext_finish_drv_i
|
||||
|
||||
wpa_driver_wext_get_range(drv);
|
||||
|
||||
+ /* Unlock the driver's BSSID and force to a random SSID so clear any
|
||||
+ * previous association the driver might have when the supplicant starts
|
||||
+ * up.
|
||||
+ */
|
||||
+ wpa_driver_wext_disconnect(drv);
|
||||
+
|
||||
drv->ifindex = if_nametoindex(drv->ifname);
|
||||
|
||||
if (os_strncmp(drv->ifname, "wlan", 4) == 0) {
|
||||
@@ -1181,8 +1188,7 @@ void wpa_driver_wext_deinit(void *priv)
|
||||
* Clear possibly configured driver parameters in order to make it
|
||||
* easier to use the driver after wpa_supplicant has been terminated.
|
||||
*/
|
||||
- (void) wpa_driver_wext_set_bssid(drv,
|
||||
- (u8 *) "\x00\x00\x00\x00\x00\x00");
|
||||
+ wpa_driver_wext_disconnect(drv);
|
||||
|
||||
wpa_driver_wext_send_oper_ifla(priv, 0, IF_OPER_UP);
|
||||
|
||||
@@ -2072,7 +2078,6 @@ static int wpa_driver_wext_mlme(struct w
|
||||
static void wpa_driver_wext_disconnect(struct wpa_driver_wext_data *drv)
|
||||
{
|
||||
struct iwreq iwr;
|
||||
- const u8 null_bssid[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 };
|
||||
u8 ssid[32];
|
||||
int i;
|
||||
|
||||
@@ -2094,7 +2099,8 @@ static void wpa_driver_wext_disconnect(s
|
||||
* even if it does not understand SIOCSIWMLME commands (or tries
|
||||
* to associate automatically after deauth/disassoc).
|
||||
*/
|
||||
- wpa_driver_wext_set_bssid(drv, null_bssid);
|
||||
+ (void) wpa_driver_wext_set_bssid(drv,
|
||||
+ (u8 *) "\x00\x00\x00\x00\x00\x00");
|
||||
|
||||
for (i = 0; i < 32; i++)
|
||||
ssid[i] = rand() & 0xFF;
|
85
wpa_supplicant-0.6.8-handle-driver-disconnect-spam.patch
Normal file
85
wpa_supplicant-0.6.8-handle-driver-disconnect-spam.patch
Normal file
@ -0,0 +1,85 @@
|
||||
diff -up wpa_supplicant-0.6.4/wpa_supplicant/events.c.disassoc-stream wpa_supplicant-0.6.4/wpa_supplicant/events.c
|
||||
--- wpa_supplicant-0.6.4/wpa_supplicant/events.c.disassoc-stream 2009-04-16 15:08:23.000000000 -0400
|
||||
+++ wpa_supplicant-0.6.4/wpa_supplicant/events.c 2009-04-16 15:44:14.000000000 -0400
|
||||
@@ -941,6 +941,15 @@ static void wpa_supplicant_event_disasso
|
||||
wpa_s->keys_cleared = 0;
|
||||
wpa_clear_keys(wpa_s, wpa_s->bssid);
|
||||
}
|
||||
+
|
||||
+ if (wpa_s->wpa_state == WPA_DISCONNECTED) {
|
||||
+ wpa_s->disconnect_count++;
|
||||
+ if (!eloop_is_timeout_registered(wpa_disconnect_spam_handle, wpa_s, NULL)) {
|
||||
+ eloop_register_timeout(6, 0, wpa_disconnect_spam_handle, wpa_s, NULL);
|
||||
+ wpa_printf(MSG_DEBUG, "%s: scheduled DISCONNECT spam handler", __FUNCTION__);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
wpa_supplicant_mark_disassoc(wpa_s);
|
||||
}
|
||||
|
||||
diff -up wpa_supplicant-0.6.4/wpa_supplicant/wpa_supplicant.c.disassoc-stream wpa_supplicant-0.6.4/wpa_supplicant/wpa_supplicant.c
|
||||
--- wpa_supplicant-0.6.4/wpa_supplicant/wpa_supplicant.c.disassoc-stream 2009-04-16 15:27:23.000000000 -0400
|
||||
+++ wpa_supplicant-0.6.4/wpa_supplicant/wpa_supplicant.c 2009-04-16 15:44:21.000000000 -0400
|
||||
@@ -460,6 +460,23 @@ const char * wpa_supplicant_state_txt(in
|
||||
}
|
||||
|
||||
|
||||
+void wpa_disconnect_spam_handle(void *eloop_ctx, void *timeout_ctx)
|
||||
+{
|
||||
+ struct wpa_supplicant *wpa_s = eloop_ctx;
|
||||
+ const u8 bssid[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "%s: %d disconnect events in 6 seconds",
|
||||
+ __FUNCTION__, wpa_s->disconnect_count);
|
||||
+
|
||||
+ if (wpa_s->disconnect_count >= 3) {
|
||||
+ wpa_printf(MSG_DEBUG, "%s: forcing SSID/BSSID reset", __FUNCTION__);
|
||||
+ wpa_drv_disassociate(wpa_s, bssid, WLAN_REASON_DEAUTH_LEAVING);
|
||||
+ wpa_supplicant_req_scan(wpa_s, 1, 0);
|
||||
+ }
|
||||
+ wpa_s->disconnect_count = 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
/**
|
||||
* wpa_supplicant_set_state - Set current connection state
|
||||
* @wpa_s: Pointer to wpa_supplicant data
|
||||
@@ -477,6 +492,18 @@ void wpa_supplicant_set_state(struct wpa
|
||||
wpa_supplicant_dbus_notify_state_change(wpa_s, state,
|
||||
wpa_s->wpa_state);
|
||||
|
||||
+ if (state != WPA_DISCONNECTED && state != WPA_SCANNING) {
|
||||
+ /* If the state isn't disconnected, cancel any registered
|
||||
+ * disconnect spam handler, which should only live while
|
||||
+ * disconnect events are coming in quickly.
|
||||
+ */
|
||||
+ wpa_s->disconnect_count = 0;
|
||||
+ if (eloop_is_timeout_registered(wpa_disconnect_spam_handle, wpa_s, NULL)) {
|
||||
+ wpa_printf(MSG_DEBUG, "%s: canceling DISCONNECT spam handler", __FUNCTION__);
|
||||
+ eloop_cancel_timeout(wpa_disconnect_spam_handle, wpa_s, NULL);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (state == WPA_COMPLETED && wpa_s->new_connection) {
|
||||
#if defined(CONFIG_CTRL_IFACE) || !defined(CONFIG_NO_STDOUT_DEBUG)
|
||||
struct wpa_ssid *ssid = wpa_s->current_ssid;
|
||||
diff -up wpa_supplicant-0.6.4/wpa_supplicant/wpa_supplicant_i.h.disassoc-stream wpa_supplicant-0.6.4/wpa_supplicant/wpa_supplicant_i.h
|
||||
--- wpa_supplicant-0.6.4/wpa_supplicant/wpa_supplicant_i.h.disassoc-stream 2009-04-16 15:12:48.000000000 -0400
|
||||
+++ wpa_supplicant-0.6.4/wpa_supplicant/wpa_supplicant_i.h 2009-04-16 15:26:48.000000000 -0400
|
||||
@@ -334,6 +334,8 @@ struct wpa_supplicant {
|
||||
struct wps_context *wps;
|
||||
int wps_success; /* WPS success event received */
|
||||
int blacklist_cleared;
|
||||
+
|
||||
+ int disconnect_count;
|
||||
};
|
||||
|
||||
|
||||
@@ -357,6 +359,7 @@ void wpa_clear_keys(struct wpa_supplican
|
||||
void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
|
||||
int sec, int usec);
|
||||
void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, wpa_states state);
|
||||
+void wpa_disconnect_spam_handle(void *eloop_ctx, void *timeout_ctx);
|
||||
struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
|
||||
void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
|
||||
void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
|
@ -2,7 +2,7 @@ Summary: WPA/WPA2/IEEE 802.1X Supplicant
|
||||
Name: wpa_supplicant
|
||||
Epoch: 1
|
||||
Version: 0.6.8
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
License: BSD
|
||||
Group: System Environment/Base
|
||||
Source0: http://hostap.epitest.fi/releases/%{name}-%{version}.tar.gz
|
||||
@ -18,6 +18,9 @@ Patch2: wpa_supplicant-0.5.7-flush-debug-output.patch
|
||||
Patch4: wpa_supplicant-0.5.10-dbus-service-file.patch
|
||||
Patch5: wpa_supplicant-0.6.7-quiet-scan-results-message.patch
|
||||
Patch6: wpa_supplicant-0.6.8-disconnect-fixes.patch
|
||||
Patch7: wpa_supplicant-0.6.8-disconnect-init-deinit.patch
|
||||
Patch8: wpa_supplicant-0.6.8-handle-driver-disconnect-spam.patch
|
||||
Patch9: wpa_supplicant-0.6.8-ap-stability.patch
|
||||
|
||||
URL: http://w1.fi/wpa_supplicant/
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
@ -51,6 +54,9 @@ Graphical User Interface for wpa_supplicant written using QT3
|
||||
%patch4 -p1 -b .dbus-service-file
|
||||
%patch5 -p1 -b .quiet-scan-results-msg
|
||||
%patch6 -p1 -b .really-disassoc
|
||||
%patch7 -p1 -b .disconnect-init-deinit
|
||||
%patch8 -p1 -b .disconnect-spam
|
||||
%patch9 -p1 -b .ap-stability
|
||||
|
||||
%build
|
||||
pushd wpa_supplicant
|
||||
@ -141,6 +147,11 @@ fi
|
||||
%{_bindir}/wpa_gui
|
||||
|
||||
%changelog
|
||||
* Tue May 12 2009 Dan Williams <dcbw@redhat.com> - 1:0.6.8-3
|
||||
- Ensure the supplicant starts and ends with clean driver state
|
||||
- Handle driver disconnect spammage by forcibly clearing SSID
|
||||
- Don't switch access points unless the current association is dire (rh #493745)
|
||||
|
||||
* Tue May 12 2009 Dan Williams <dcbw@redhat.com> - 1:0.6.8-2
|
||||
- Avoid creating bogus Ad-Hoc networks when forcing the driver to disconnect (rh #497771)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user