- Update to 0.6.4

- Remove 'hostap', 'madwifi', and 'prism54' drivers; use standard 'wext'
    instead
- Drop upstreamed patches
This commit is contained in:
Daniel Williams 2008-08-27 21:14:47 +00:00
parent 3b4d3de16a
commit 229cd7199e
10 changed files with 35 additions and 373 deletions

View File

@ -6,3 +6,4 @@ madwifi-headers-r1475.tar.bz2
wpa_supplicant-0.4.9.tar.gz
wpa_supplicant-0.5.7.tar.gz
wpa_supplicant-0.6.3.tar.gz
wpa_supplicant-0.6.4.tar.gz

View File

@ -1,2 +1 @@
b82289b140cc1c66db11564bde248d8a madwifi-headers-r1475.tar.bz2
b51b2975f21006f85f7297f3fb1acde1 wpa_supplicant-0.6.3.tar.gz
eb06a9a05d3916addf9451297a558aa2 wpa_supplicant-0.6.4.tar.gz

View File

@ -1,163 +0,0 @@
commit 7e1488494e0150ee7fdef83355266b5633c5c1b0
Author: Dan Williams <dcbw@redhat.com>
Date: Tue Jun 3 11:37:48 2008 +0300
Do not continually reschedule specific scans to help finding hidden SSIDs
In situations where the driver does background scanning and sends a
steady stream of scan results, wpa_supplicant would continually
reschedule the scan. This resulted in specific SSID scans never
happening for a hidden AP, and the supplicant never connecting to the AP
because it never got found. Instead, if there's an already scheduled
scan, and a request comes in to reschedule it, and there are enabled
scan_ssid=1 network blocks, let the scan happen anyway so the hidden
SSID has a chance to be found.
diff --git a/src/utils/eloop.c b/src/utils/eloop.c
index f988e94..4edb2a7 100644
--- a/src/utils/eloop.c
+++ b/src/utils/eloop.c
@@ -315,6 +315,25 @@ int eloop_cancel_timeout(eloop_timeout_handler handler,
}
+int eloop_is_timeout_registered(eloop_timeout_handler handler,
+ void *eloop_data, void *user_data)
+{
+ struct eloop_timeout *tmp;
+
+ tmp = eloop.timeout;
+ while (tmp != NULL) {
+ if (tmp->handler == handler &&
+ tmp->eloop_data == eloop_data &&
+ tmp->user_data == user_data)
+ return 1;
+
+ tmp = tmp->next;
+ }
+
+ return 0;
+}
+
+
#ifndef CONFIG_NATIVE_WINDOWS
static void eloop_handle_alarm(int sig)
{
diff --git a/src/utils/eloop.h b/src/utils/eloop.h
index 4dd2871..cf83f38 100644
--- a/src/utils/eloop.h
+++ b/src/utils/eloop.h
@@ -207,6 +207,19 @@ int eloop_cancel_timeout(eloop_timeout_handler handler,
void *eloop_data, void *user_data);
/**
+ * eloop_is_timeout_registered - Check if a timeout is already registered
+ * @handler: Matching callback function
+ * @eloop_data: Matching eloop_data
+ * @user_data: Matching user_data
+ * Returns: 1 if the timeout is registered, 0 if the timeout is not registered
+ *
+ * Determine if a matching <handler,eloop_data,user_data> timeout is registered
+ * with eloop_register_timeout().
+ */
+int eloop_is_timeout_registered(eloop_timeout_handler handler,
+ void *eloop_data, void *user_data);
+
+/**
* eloop_register_signal - Register handler for signals
* @sig: Signal number (e.g., SIGHUP)
* @handler: Callback function to be called when the signal is received
diff --git a/src/utils/eloop_none.c b/src/utils/eloop_none.c
index 6943109..215030b 100644
--- a/src/utils/eloop_none.c
+++ b/src/utils/eloop_none.c
@@ -197,6 +197,26 @@ int eloop_cancel_timeout(void (*handler)(void *eloop_ctx, void *sock_ctx),
}
+int eloop_is_timeout_registered(void (*handler)(void *eloop_ctx,
+ void *timeout_ctx),
+ void *eloop_data, void *user_data)
+{
+ struct eloop_timeout *tmp;
+
+ tmp = eloop.timeout;
+ while (tmp != NULL) {
+ if (tmp->handler == handler &&
+ tmp->eloop_data == eloop_data &&
+ tmp->user_data == user_data)
+ return 1;
+
+ tmp = tmp->next;
+ }
+
+ return 0;
+}
+
+
/* TODO: replace with suitable signal handler */
#if 0
static void eloop_handle_signal(int sig)
diff --git a/src/utils/eloop_win.c b/src/utils/eloop_win.c
index 73f0eaf..a1ccd94 100644
--- a/src/utils/eloop_win.c
+++ b/src/utils/eloop_win.c
@@ -320,6 +320,25 @@ int eloop_cancel_timeout(eloop_timeout_handler handler,
}
+int eloop_is_timeout_registered(eloop_timeout_handler handler,
+ void *eloop_data, void *user_data)
+{
+ struct eloop_timeout *tmp;
+
+ tmp = eloop.timeout;
+ while (tmp != NULL) {
+ if (tmp->handler == handler &&
+ tmp->eloop_data == eloop_data &&
+ tmp->user_data == user_data)
+ return 1;
+
+ tmp = tmp->next;
+ }
+
+ return 0;
+}
+
+
/* TODO: replace with suitable signal handler */
#if 0
static void eloop_handle_signal(int sig)
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index b046d90..c2549e2 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -172,6 +172,28 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
*/
void wpa_supplicant_req_scan(struct wpa_supplicant *wpa_s, int sec, int usec)
{
+ /* If there's at least one network that should be specifically scanned
+ * then don't cancel the scan and reschedule. Some drivers do
+ * background scanning which generates frequent scan results, and that
+ * causes the specific SSID scan to get continually pushed back and
+ * never happen, which causes hidden APs to never get probe-scanned.
+ */
+ if (eloop_is_timeout_registered(wpa_supplicant_scan, wpa_s, NULL) &&
+ wpa_s->conf->ap_scan == 1) {
+ struct wpa_ssid *ssid = wpa_s->conf->ssid;
+
+ while (ssid) {
+ if (!ssid->disabled && ssid->scan_ssid)
+ break;
+ ssid = ssid->next;
+ }
+ if (ssid) {
+ wpa_msg(wpa_s, MSG_DEBUG, "Not rescheduling scan to "
+ "ensure that specific SSID scans occur");
+ return;
+ }
+ }
+
wpa_msg(wpa_s, MSG_DEBUG, "Setting scan request: %d sec %d usec",
sec, usec);
eloop_cancel_timeout(wpa_supplicant_scan, wpa_s, NULL);

View File

@ -1,13 +0,0 @@
diff --git a/wpa_supplicant/dbus_dict_helpers.c b/wpa_supplicant/dbus_dict_helpers.c
index 1232ab2..d810979 100644
--- a/wpa_supplicant/dbus_dict_helpers.c
+++ b/wpa_supplicant/dbus_dict_helpers.c
@@ -674,7 +674,7 @@ static dbus_bool_t _wpa_dbus_dict_entry_get_byte_array(
/* Zero-length arrays are valid. */
if (entry->array_len == 0) {
free(entry->bytearray_value);
- entry->strarray_value = NULL;
+ entry->bytearray_value = NULL;
}
success = TRUE;

View File

@ -1,35 +0,0 @@
commit 2e5a7b49a0a52ce36033e4839aae90e638746b6a
Author: Dan Williams <dcbw@redhat.com>
Date: Mon Jun 2 20:47:09 2008 +0300
wext: don't overwrite BSS frequency
mac80211 sends _both_ channel and frequency in it's scan results, with
frequency first and channel second (it's since been fixed to send
channel first and frequency second to work around this issue). This
results in wpa_supplicant getting the right value when the frequency
comes, but overwriting the value with '0' when the channel comes because
wpa_supplicant can't handle 5GHz channel numbers. So if a valid
previous SIOCGIWFREQ event came in, don't try to overwrite it.
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index f9c86bb..efa88a8 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -1294,8 +1294,15 @@ static void wext_get_scan_freq(struct iw_event *iwe,
/*
* Some drivers do not report frequency, but a channel.
* Try to map this to frequency by assuming they are using
- * IEEE 802.11b/g.
+ * IEEE 802.11b/g. But don't overwrite a previously parsed
+ * frequency if the driver sends both frequency and channel,
+ * since the driver may be sending an A-band channel that we
+ * don't handle here.
*/
+
+ if (res->res.freq)
+ return;
+
if (iwe->u.freq.m >= 1 && iwe->u.freq.m <= 13) {
res->res.freq = 2407 + 5 * iwe->u.freq.m;
return;

View File

@ -1,74 +0,0 @@
commit 59c9707863336c1255936c755d24c8eb1ed8db2f
Author: Dan Williams <dcbw@redhat.com>
Date: Wed Jun 4 20:55:57 2008 +0300
wext: handle mode switches correctly for mac80211
Since mac80211 requires that the device be !IFF_UP to change the mode
(and I think the old prism54 fullmac driver does too), do that. This
shouldn't harm fullmac devices since they can handle mode switches on
the fly and usually don't care about up/down that much.
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index 1226b94..c9d7399 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -2151,17 +2151,54 @@ int wpa_driver_wext_set_mode(void *priv, int mode)
{
struct wpa_driver_wext_data *drv = priv;
struct iwreq iwr;
- int ret = 0;
+ int ret = -1, flags;
+ unsigned int new_mode = mode ? IW_MODE_ADHOC : IW_MODE_INFRA;
os_memset(&iwr, 0, sizeof(iwr));
os_strlcpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
- iwr.u.mode = mode ? IW_MODE_ADHOC : IW_MODE_INFRA;
+ iwr.u.mode = new_mode;
+ if (ioctl(drv->ioctl_sock, SIOCSIWMODE, &iwr) == 0) {
+ ret = 0;
+ goto done;
+ }
- if (ioctl(drv->ioctl_sock, SIOCSIWMODE, &iwr) < 0) {
+ if (errno != EBUSY) {
perror("ioctl[SIOCSIWMODE]");
- ret = -1;
+ goto done;
+ }
+
+ /* mac80211 doesn't allow mode changes while the device is up, so if
+ * the device isn't in the mode we're about to change to, take device
+ * down, try to set the mode again, and bring it back up.
+ */
+ if (ioctl(drv->ioctl_sock, SIOCGIWMODE, &iwr) < 0) {
+ perror("ioctl[SIOCGIWMODE]");
+ goto done;
+ }
+
+ if (iwr.u.mode == new_mode) {
+ ret = 0;
+ goto done;
+ }
+
+ if (wpa_driver_wext_get_ifflags(drv, &flags) == 0) {
+ (void) wpa_driver_wext_set_ifflags(drv, flags & ~IFF_UP);
+
+ /* Try to set the mode again while the interface is down */
+ iwr.u.mode = new_mode;
+ if (ioctl(drv->ioctl_sock, SIOCSIWMODE, &iwr) < 0)
+ perror("ioctl[SIOCSIWMODE]");
+ else
+ ret = 0;
+
+ /* Ignore return value of get_ifflags to ensure that the device
+ * is always up like it was before this function was called.
+ */
+ (void) wpa_driver_wext_get_ifflags(drv, &flags);
+ (void) wpa_driver_wext_set_ifflags(drv, flags | IFF_UP);
}
+done:
return ret;
}

View File

@ -1,45 +0,0 @@
diff -up wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/networkconfig.ui.h.atoi wpa_supplicant-0.5.7/wpa_gui/networkconfig.ui.h
--- wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/networkconfig.ui.h.atoi 2006-12-09 19:38:48.000000000 -0500
+++ wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/networkconfig.ui.h 2008-02-22 11:51:28.000000000 -0500
@@ -10,6 +10,7 @@
** destructor.
*****************************************************************************/
+#include <stdlib.h>
enum {
AUTH_NONE = 0,
diff -up wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/wpagui.ui.h.atoi wpa_supplicant-0.5.7/wpa_gui/wpagui.ui.h
--- wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/wpagui.ui.h.atoi 2008-02-22 14:39:19.000000000 -0500
+++ wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/wpagui.ui.h 2008-02-22 14:39:31.000000000 -0500
@@ -16,6 +16,7 @@
#include <unistd.h>
#endif
+#include <stdlib.h>
void WpaGui::init()
{
diff -up wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/userdatarequest.ui.h.atoi wpa_supplicant-0.5.7/wpa_gui/userdatarequest.ui.h
--- wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/userdatarequest.ui.h.atoi 2008-02-22 14:38:32.000000000 -0500
+++ wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/userdatarequest.ui.h 2008-02-22 14:38:56.000000000 -0500
@@ -10,6 +10,8 @@
** destructor.
*****************************************************************************/
+#include <stdlib.h>
+
int UserDataRequest::setParams(WpaGui *_wpagui, const char *reqMsg)
{
char *tmp, *pos, *pos2;
diff -up wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/wpamsg.h.fix wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/wpamsg.h
--- wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/wpamsg.h.fix 2008-03-03 11:58:18.000000000 -0500
+++ wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/wpamsg.h 2008-03-03 11:58:33.000000000 -0500
@@ -14,6 +14,7 @@ typedef QValueList<WpaMsg> WpaMsgList;
class WpaMsg {
public:
+ WpaMsg() {}
WpaMsg(const QString &_msg, int _priority = 2)
: msg(_msg), priority(_priority)
{

View File

@ -1,14 +1,16 @@
--- wpa_supplicant-0.6.3/wpa_supplicant/wpa_supplicant.c.timeout 2006-03-03 22:26:13.000000000 -0500
+++ wpa_supplicant-0.6.3/wpa_supplicant/wpa_supplicant.c 2006-03-03 22:26:45.000000000 -0500
@@ -1252,9 +1252,9 @@
/* Timeout for IEEE 802.11 authentication and association */
int timeout;
if (assoc_failed)
- timeout = 5;
+ timeout = 15;
else if (wpa_s->conf->ap_scan == 1)
- timeout = 10;
+ timeout = 20;
else
timeout = 60;
diff -up wpa_supplicant-0.6.4/wpa_supplicant/wpa_supplicant.c.assoc-timeout wpa_supplicant-0.6.4/wpa_supplicant/wpa_supplicant.c
--- wpa_supplicant-0.6.4/wpa_supplicant/wpa_supplicant.c.assoc-timeout 2008-08-27 17:01:00.000000000 -0400
+++ wpa_supplicant-0.6.4/wpa_supplicant/wpa_supplicant.c 2008-08-27 17:01:22.000000000 -0400
@@ -1094,10 +1094,10 @@ void wpa_supplicant_associate(struct wpa
if (assoc_failed) {
/* give IBSS a bit more time */
- timeout = ssid->mode ? 10 : 5;
+ timeout = ssid->mode ? 20 : 10;
} else if (wpa_s->conf->ap_scan == 1) {
/* give IBSS a bit more time */
- timeout = ssid->mode ? 20 : 10;
+ timeout = ssid->mode ? 20 : 20;
}
wpa_supplicant_req_auth_timeout(wpa_s, timeout, 0);
}

View File

@ -1,12 +1,12 @@
CONFIG_CTRL_IFACE=y
CONFIG_CTRL_IFACE_DBUS=y
CONFIG_DRIVER_HOSTAP=y
//CONFIG_DRIVER_HOSTAP=y
//CONFIG_DRIVER_HERMES=y
CONFIG_DRIVER_MADWIFI=y
//CONFIG_DRIVER_MADWIFI=y
CONFIG_DRIVER_ATMEL=y
CONFIG_DRIVER_WEXT=y
CONFIG_DRIVER_NDISWRAPPER=y
CONFIG_DRIVER_PRISM54=y
//CONFIG_DRIVER_PRISM54=y
CONFIG_DRIVER_WIRED=y
//CONFIG_DRIVER_BROADCOM=y
//CONFIG_DRIVER_IPW=y

View File

@ -1,8 +1,8 @@
Summary: WPA/WPA2/IEEE 802.1X Supplicant
Name: wpa_supplicant
Epoch: 1
Version: 0.6.3
Release: 6%{?dist}
Version: 0.6.4
Release: 1%{?dist}
License: BSD
Group: System Environment/Base
Source0: http://hostap.epitest.fi/releases/%{name}-%{version}.tar.gz
@ -10,19 +10,13 @@ Source1: %{name}.config
Source2: %{name}.conf
Source3: %{name}.init.d
Source4: %{name}.sysconfig
Source5: madwifi-headers-r1475.tar.bz2
Source6: %{name}.logrotate
Patch0: wpa_supplicant-assoc-timeout.patch
Patch1: wpa_supplicant-0.6.3-wpa-gui-fixes.patch
Patch2: wpa_supplicant-0.5.7-qmake-location.patch
Patch3: wpa_supplicant-0.5.7-flush-debug-output.patch
Patch4: wpa_supplicant-0.5.7-use-IW_ENCODE_TEMP.patch
Patch5: wpa_supplicant-0.5.10-dbus-service-file.patch
Patch6: wpa_supplicant-0.6.3-fix-dbus-use-after-free.patch
Patch7: wpa_supplicant-0.6.3-wext-dont-overwrite-BSS-frequency.patch
Patch8: wpa_supplicant-0.6.3-dont-reschedule-specific-scans.patch
Patch9: wpa_supplicant-0.6.3-wext-handle-mac80211-mode-switches.patch
Patch1: wpa_supplicant-0.5.7-qmake-location.patch
Patch2: wpa_supplicant-0.5.7-flush-debug-output.patch
Patch3: wpa_supplicant-0.5.7-use-IW_ENCODE_TEMP.patch
Patch4: wpa_supplicant-0.5.10-dbus-service-file.patch
URL: http://w1.fi/wpa_supplicant/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -51,21 +45,12 @@ Graphical User Interface for wpa_supplicant written using QT3
%prep
%setup -q
%patch0 -p1 -b .assoc-timeout
%patch1 -p1 -b .wpa-gui-fixes
%patch2 -p1 -b .qmake-location
%patch3 -p1 -b .flush-debug-output
%patch4 -p1 -b .use-IW_ENCODE_TEMP
%patch5 -p1 -b .dbus-service-file
%patch6 -p1 -b .use-after-free
%patch7 -p1 -b .bss-freq
%patch8 -p1 -b .ssid-scans
%patch9 -p1 -b .mac80211-mode
%patch1 -p1 -b .qmake-location
%patch2 -p1 -b .flush-debug-output
%patch3 -p1 -b .use-IW_ENCODE_TEMP
%patch4 -p1 -b .dbus-service-file
%build
pushd src
tar -xjf %{SOURCE5}
popd
pushd wpa_supplicant
cp %{SOURCE1} ./.config
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ;
@ -153,6 +138,11 @@ fi
%{_bindir}/wpa_gui
%changelog
* Wed Aug 27 2008 Dan Williams <dcbw@redhat.com> - 1:0.6.4-1
- Update to 0.6.4
- Remove 'hostap', 'madwifi', and 'prism54' drivers; use standard 'wext' instead
- Drop upstreamed patches
* Tue Jun 10 2008 Dan Williams <dcbw@redhat.com> - 1:0.6.3-6
- Fix 802.11a frequency bug
- Always schedule specific SSID scans to help find hidden APs