rpms/wpa_supplicant/F-11 wpa_supplicant-0.6.8-ap-stability.patch, NONE, 1.1 wpa_supplicant-0.6.8-disconnect-init-deinit.patch, NONE, 1.1 wpa_supplicant-0.6.8-handle-driver-disconnect-spam.patch, NONE, 1.1 wpa_supplicant-0.6.8-scanning-property.patch, NONE, 1.1 wpa_supplicant.spec, 1.57, 1.58
Daniel Williams
dcbw at fedoraproject.org
Wed May 13 14:56:01 UTC 2009
- Previous message: rpms/wpa_supplicant/devel wpa_supplicant-0.6.8-scanning-property.patch, NONE, 1.1 wpa_supplicant.spec, 1.58, 1.59
- Next message: rpms/perl-Crypt-Twofish/F-10 perl-Crypt-Twofish.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: dcbw
Update of /cvs/extras/rpms/wpa_supplicant/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24467
Modified Files:
wpa_supplicant.spec
Added Files:
wpa_supplicant-0.6.8-ap-stability.patch
wpa_supplicant-0.6.8-disconnect-init-deinit.patch
wpa_supplicant-0.6.8-handle-driver-disconnect-spam.patch
wpa_supplicant-0.6.8-scanning-property.patch
Log Message:
* Wed May 13 2009 Dan Williams <dcbw at redhat.com> - 1:0.6.8-4
- Let D-Bus clients know when the supplicant is scanning
* Tue May 12 2009 Dan Williams <dcbw at 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)
wpa_supplicant-0.6.8-ap-stability.patch:
--- NEW FILE wpa_supplicant-0.6.8-ap-stability.patch ---
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)
{
wpa_supplicant-0.6.8-disconnect-init-deinit.patch:
--- NEW FILE wpa_supplicant-0.6.8-disconnect-init-deinit.patch ---
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;
wpa_supplicant-0.6.8-handle-driver-disconnect-spam.patch:
--- NEW FILE wpa_supplicant-0.6.8-handle-driver-disconnect-spam.patch ---
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,
wpa_supplicant-0.6.8-scanning-property.patch:
--- NEW FILE wpa_supplicant-0.6.8-scanning-property.patch ---
diff --git a/wpa_supplicant/ctrl_iface_dbus.c b/wpa_supplicant/ctrl_iface_dbus.c
index 26a3e9d..9e3ae69 100644
--- a/wpa_supplicant/ctrl_iface_dbus.c
+++ b/wpa_supplicant/ctrl_iface_dbus.c
@@ -541,6 +541,8 @@ static DBusHandlerResult wpas_iface_message_handler(DBusConnection *connection,
wpa_s);
else if (!strcmp(method, "state"))
reply = wpas_dbus_iface_get_state(message, wpa_s);
+ else if (!strcmp(method, "scanning"))
+ reply = wpas_dbus_iface_get_scanning(message, wpa_s);
else if (!strcmp(method, "setBlobs"))
reply = wpas_dbus_iface_set_blobs(message, wpa_s);
else if (!strcmp(method, "removeBlobs"))
@@ -753,6 +755,58 @@ out:
}
+/**
+ * wpa_supplicant_dbus_notify_scanning - send scanning status
+ * @wpa_s: %wpa_supplicant network interface data
+ * Returns: 0 on success, -1 on failure
+ *
+ * Notify listeners of interface scanning state changes
+ */
+void wpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s)
+{
+ struct ctrl_iface_dbus_priv *iface = wpa_s->global->dbus_ctrl_iface;
+ DBusMessage *_signal;
+ const char *path;
+ dbus_bool_t scanning = wpa_s->scanning ? TRUE : FALSE;
+
+ /* Do nothing if the control interface is not turned on */
+ if (iface == NULL)
+ return;
+
+ path = wpa_supplicant_get_dbus_path(wpa_s);
+ if (path == NULL) {
+ perror("wpa_supplicant_dbus_notify_scanning[dbus]: interface "
+ "didn't have a dbus path");
+ wpa_printf(MSG_ERROR,
+ "%s[dbus]: interface didn't have a dbus path; can't "
+ " send scan result signal.", __FUNCTION__);
+ return;
+ }
+ _signal = dbus_message_new_signal(path, WPAS_DBUS_IFACE_INTERFACE,
+ "Scanning");
+ if (_signal == NULL) {
+ perror("wpa_supplicant_dbus_notify_scanning[dbus]: couldn't "
+ "create dbus signal; likely out of memory");
+ wpa_printf(MSG_ERROR, "%s[dbus]: dbus control interface: not "
+ "enough memory to send scan results signal.",
+ __FUNCTION__);
+ return;
+ }
+
+ if (dbus_message_append_args(_signal,
+ DBUS_TYPE_BOOLEAN, &scanning,
+ DBUS_TYPE_INVALID)) {
+ dbus_connection_send(iface->con, _signal, NULL);
+ } else {
+ perror("wpa_supplicant_dbus_notify_scanning[dbus]: not enough "
+ "memory to construct signal.");
+ wpa_printf(MSG_ERROR, "%s[dbus]: not enough memory to construct"
+ " signal.", __FUNCTION__);
+ }
+ dbus_message_unref(_signal);
+}
+
+
#ifdef CONFIG_WPS
void wpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s,
const struct wps_credential *cred)
diff --git a/wpa_supplicant/ctrl_iface_dbus.h b/wpa_supplicant/ctrl_iface_dbus.h
index 8e9036d..0e3ec79 100644
--- a/wpa_supplicant/ctrl_iface_dbus.h
+++ b/wpa_supplicant/ctrl_iface_dbus.h
@@ -92,6 +92,7 @@ struct ctrl_iface_dbus_priv *
wpa_supplicant_dbus_ctrl_iface_init(struct wpa_global *global);
void wpa_supplicant_dbus_ctrl_iface_deinit(struct ctrl_iface_dbus_priv *iface);
void wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s);
+void wpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s);
void wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s,
wpa_states new_state,
wpa_states old_state);
@@ -136,6 +137,11 @@ wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s)
}
static inline void
+wpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s)
+{
+}
+
+static inline void
wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s,
wpa_states new_state,
wpa_states old_state)
diff --git a/wpa_supplicant/ctrl_iface_dbus_handlers.c b/wpa_supplicant/ctrl_iface_dbus_handlers.c
index e9dd9a5..a30bce0 100644
--- a/wpa_supplicant/ctrl_iface_dbus_handlers.c
+++ b/wpa_supplicant/ctrl_iface_dbus_handlers.c
@@ -1338,6 +1338,35 @@ DBusMessage * wpas_dbus_iface_get_state(DBusMessage *message,
/**
+ * wpas_dbus_iface_get_scanning - Get interface scanning state
+ * @message: Pointer to incoming dbus message
+ * @wpa_s: wpa_supplicant structure for a network interface
+ * Returns: A dbus message containing whether the interface is scanning
+ *
+ * Handler function for "scanning" method call.
+ */
+DBusMessage * wpas_dbus_iface_get_scanning(DBusMessage *message,
+ struct wpa_supplicant *wpa_s)
+{
+ DBusMessage *reply = NULL;
+ dbus_bool_t scanning = wpa_s->scanning ? TRUE : FALSE;
+
+ reply = dbus_message_new_method_return(message);
+ if (reply != NULL) {
+ dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &scanning,
+ DBUS_TYPE_INVALID);
+ } else {
+ perror("wpas_dbus_iface_get_scanning[dbus]: out of "
+ "memory.");
+ wpa_printf(MSG_ERROR, "dbus control interface: not enough"
+ "memory to return scanning state.");
+ }
+
+ return reply;
+}
+
+
+/**
* wpas_dbus_iface_set_blobs - Store named binary blobs (ie, for certificates)
* @message: Pointer to incoming dbus message
* @wpa_s: %wpa_supplicant data structure
diff --git a/wpa_supplicant/ctrl_iface_dbus_handlers.h b/wpa_supplicant/ctrl_iface_dbus_handlers.h
index 0df5f3e..6564b54 100644
--- a/wpa_supplicant/ctrl_iface_dbus_handlers.h
+++ b/wpa_supplicant/ctrl_iface_dbus_handlers.h
@@ -77,6 +77,9 @@ DBusMessage * wpas_dbus_iface_set_smartcard_modules(
DBusMessage * wpas_dbus_iface_get_state(DBusMessage *message,
struct wpa_supplicant *wpa_s);
+DBusMessage * wpas_dbus_iface_get_scanning(DBusMessage *message,
+ struct wpa_supplicant *wpa_s);
+
DBusMessage * wpas_dbus_iface_set_blobs(DBusMessage *message,
struct wpa_supplicant *wpa_s);
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 56c57fb..159b024 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -615,6 +615,8 @@ static void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s)
int qual = 0, max_qual = 0, qual_valid = 0, bssid_valid = 0, i;
struct cur_ap cur;
+ wpa_supplicant_notify_scanning(wpa_s, 0);
+
if (wpa_supplicant_get_scan_results(wpa_s) < 0) {
if (wpa_s->conf->ap_scan == 2)
return;
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 1f53e23..a30e387 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -21,6 +21,7 @@
#include "wpa_supplicant_i.h"
#include "mlme.h"
#include "wps_supplicant.h"
+#include "ctrl_iface_dbus.h"
static void wpa_supplicant_gen_assoc_event(struct wpa_supplicant *wpa_s)
@@ -328,6 +328,8 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
}
#endif /* CONFIG_WPS */
+ wpa_supplicant_notify_scanning(wpa_s, 1);
+
if (wpa_s->use_client_mlme) {
ieee80211_sta_set_probe_req_ie(wpa_s, extra_ie, extra_ie_len);
ret = ieee80211_sta_req_scan(wpa_s, ssid ? ssid->ssid : NULL,
@@ -344,6 +346,7 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
if (ret) {
wpa_printf(MSG_WARNING, "Failed to initiate AP scan.");
+ wpa_supplicant_notify_scanning(wpa_s, 0);
wpa_supplicant_req_scan(wpa_s, 10, 0);
} else
wpa_s->scan_runs++;
@@ -402,3 +405,13 @@ void wpa_supplicant_cancel_scan(struct wpa_supplicant *wpa_s)
wpa_msg(wpa_s, MSG_DEBUG, "Cancelling scan request");
eloop_cancel_timeout(wpa_supplicant_scan, wpa_s, NULL);
}
+
+void wpa_supplicant_notify_scanning(struct wpa_supplicant *wpa_s,
+ int scanning)
+{
+ if (wpa_s->scanning != scanning) {
+ wpa_s->scanning = scanning;
+ wpa_supplicant_dbus_notify_scanning(wpa_s);
+ }
+}
+
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 723e2ed..3bfffa2 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -514,6 +514,9 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, wpa_states state)
wpa_supplicant_state_txt(wpa_s->wpa_state),
wpa_supplicant_state_txt(state));
+ if (state != WPA_SCANNING)
+ wpa_supplicant_notify_scanning(wpa_s, 0);
+
wpa_supplicant_dbus_notify_state_change(wpa_s, state,
wpa_s->wpa_state);
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index 8d131fc..63984d8 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -329,6 +329,7 @@ struct wpa_supplicant {
struct ctrl_iface_priv *ctrl_iface;
wpa_states wpa_state;
+ int scanning;
int new_connection;
int reassociated_connection;
@@ -431,6 +432,8 @@ int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
/* scan.c */
void wpa_supplicant_req_scan(struct wpa_supplicant *wpa_s, int sec, int usec);
void wpa_supplicant_cancel_scan(struct wpa_supplicant *wpa_s);
+void wpa_supplicant_notify_scanning(struct wpa_supplicant *wpa_s,
+ int scanning);
/* events.c */
void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
Index: wpa_supplicant.spec
===================================================================
RCS file: /cvs/extras/rpms/wpa_supplicant/F-11/wpa_supplicant.spec,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -p -r1.57 -r1.58
--- wpa_supplicant.spec 12 May 2009 18:15:01 -0000 1.57
+++ wpa_supplicant.spec 13 May 2009 14:56:01 -0000 1.58
@@ -2,7 +2,7 @@ Summary: WPA/WPA2/IEEE 802.1X Supplicant
Name: wpa_supplicant
Epoch: 1
Version: 0.6.8
-Release: 2%{?dist}
+Release: 4%{?dist}
License: BSD
Group: System Environment/Base
Source0: http://hostap.epitest.fi/releases/%{name}-%{version}.tar.gz
@@ -18,6 +18,10 @@ Patch2: wpa_supplicant-0.5.7-flush-debug
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
+Patch10: wpa_supplicant-0.6.8-scanning-property.patch
URL: http://w1.fi/wpa_supplicant/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -51,6 +55,10 @@ Graphical User Interface for wpa_supplic
%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
+%patch10 -p1 -b .scanning-property
%build
pushd wpa_supplicant
@@ -141,6 +149,14 @@ fi
%{_bindir}/wpa_gui
%changelog
+* Wed May 13 2009 Dan Williams <dcbw at redhat.com> - 1:0.6.8-4
+- Let D-Bus clients know when the supplicant is scanning
+
+* Tue May 12 2009 Dan Williams <dcbw at 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 at redhat.com> - 1:0.6.8-2
- Avoid creating bogus Ad-Hoc networks when forcing the driver to disconnect (rh #497771)
- Previous message: rpms/wpa_supplicant/devel wpa_supplicant-0.6.8-scanning-property.patch, NONE, 1.1 wpa_supplicant.spec, 1.58, 1.59
- Next message: rpms/perl-Crypt-Twofish/F-10 perl-Crypt-Twofish.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the scm-commits
mailing list