[wpa_supplicant] Fix driver fallback for non nl80211-based drivers (rh #783712)
Daniel Williams
dcbw at fedoraproject.org
Fri Feb 3 15:29:44 UTC 2012
commit cbc1a0f900a84a30798b6de5537a7e61146c59f3
Author: Dan Williams <dcbw at redhat.com>
Date: Fri Feb 3 09:30:41 2012 -0600
Fix driver fallback for non nl80211-based drivers (rh #783712)
.gitignore | 1 +
...o-other-drivers-if-global-init-for-one-dr.patch | 43 ++++++++++++++++++++
sources | 2 +-
wpa_supplicant-0.7.2-generate-libeap-peer.patch | 4 +-
wpa_supplicant.spec | 13 +++++-
5 files changed, 58 insertions(+), 5 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 3086de5..b78ab2f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,4 @@ wpa_supplicant-0.6.7.tar.gz
wpa_supplicant-0.6.8.tar.gz
/wpa_supplicant-0.7.3.tar.gz
/wpa_supplicant-1.0-rc1.tar.gz
+/wpa_supplicant-1.0-rc2.tar.gz
diff --git a/0001-Fall-back-to-other-drivers-if-global-init-for-one-dr.patch b/0001-Fall-back-to-other-drivers-if-global-init-for-one-dr.patch
new file mode 100644
index 0000000..97b5256
--- /dev/null
+++ b/0001-Fall-back-to-other-drivers-if-global-init-for-one-dr.patch
@@ -0,0 +1,43 @@
+From 5187ff694dfc9823460b8dea1bb74a7a30d2e58c Mon Sep 17 00:00:00 2001
+From: Dan Williams <dcbw at redhat.com>
+Date: Thu, 2 Feb 2012 15:43:25 -0600
+Subject: [PATCH] Fall back to other drivers if global init for one driver
+ fails
+
+Driver global init was considered a hard failure. Thus if, for
+example, you used the Broadcom STA driver and didn't have nl80211
+or cfg80211 loaded into the kernel, and specified a driver value
+of "nl80211,wext", the nl80211 driver's global init would fail
+with the following message:
+
+nl80211: 'nl80211' generic netlink not found
+Failed to initialize driver 'nl80211'
+
+but since global init was a hard failure, creating the supplicant
+interface would fail and the WEXT driver would not be tried.
+Give other drivers a chance instead.
+---
+ wpa_supplicant/wpa_supplicant.c | 7 +++++--
+ 1 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
+index ee5ca8d..6320918 100644
+--- a/wpa_supplicant/wpa_supplicant.c
++++ b/wpa_supplicant/wpa_supplicant.c
+@@ -1941,8 +1941,11 @@ static int wpa_supplicant_set_driver(struct wpa_supplicant *wpa_s,
+ for (i = 0; wpa_drivers[i]; i++) {
+ if (os_strlen(wpa_drivers[i]->name) == len &&
+ os_strncmp(driver, wpa_drivers[i]->name, len) ==
+- 0)
+- return select_driver(wpa_s, i);
++ 0) {
++ /* First driver that succeeds wins */
++ if (select_driver(wpa_s, i) == 0)
++ return 0;
++ }
+ }
+
+ driver = pos + 1;
+--
+1.7.7.6
+
diff --git a/sources b/sources
index 8dadd7f..f24b76b 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-5e16238b661b5230a753b355d4845477 wpa_supplicant-1.0-rc1.tar.gz
+f2f90dfa7341e64dc3ac6766f49b3cb4 wpa_supplicant-1.0-rc2.tar.gz
diff --git a/wpa_supplicant-0.7.2-generate-libeap-peer.patch b/wpa_supplicant-0.7.2-generate-libeap-peer.patch
index 915afa3..f4c38d2 100644
--- a/wpa_supplicant-0.7.2-generate-libeap-peer.patch
+++ b/wpa_supplicant-0.7.2-generate-libeap-peer.patch
@@ -42,7 +42,7 @@ diff --git a/src/eap_peer/Makefile b/src/eap_peer/Makefile
index 3651056..58c067a 100644
--- a/src/eap_peer/Makefile
+++ b/src/eap_peer/Makefile
-@@ -1,11 +1,190 @@
+@@ -1,11 +1,192 @@
-all:
- @echo Nothing to be made.
+LIBEAP_NAME = libeap
@@ -83,6 +83,7 @@ index 3651056..58c067a 100644
+override CFLAGS += -I ../../wpa_supplicant
+
+OBJS_both += ../utils/common.o
++OBJS_both += ../utils/eloop.o
+OBJS_both += ../utils/os_unix.o
+OBJS_both += ../utils/wpa_debug.o
+OBJS_both += ../utils/base64.o
@@ -97,6 +98,7 @@ index 3651056..58c067a 100644
+OBJS_both += ../crypto/aes-omac1.o
+OBJS_both += ../crypto/ms_funcs.o
+OBJS_both += ../crypto/sha256.o
++OBJS_both += ../crypto/random.o
+
+
+OBJS_both += ../eap_common/eap_peap_common.o
diff --git a/wpa_supplicant.spec b/wpa_supplicant.spec
index dde4e26..0e38fe0 100644
--- a/wpa_supplicant.spec
+++ b/wpa_supplicant.spec
@@ -1,11 +1,13 @@
+%define rcver -rc2
+
Summary: WPA/WPA2/IEEE 802.1X Supplicant
Name: wpa_supplicant
Epoch: 1
Version: 1.0
-Release: 0.1%{?dist}
+Release: 0.2%{?dist}
License: BSD
Group: System Environment/Base
-Source0: http://w1.fi/releases/%{name}-%{version}-rc1.tar.gz
+Source0: http://w1.fi/releases/%{name}-%{version}%{rcver}.tar.gz
Source1: build-config
Source2: %{name}.conf
Source3: %{name}.service
@@ -35,6 +37,7 @@ Patch5: wpa_supplicant-openssl-more-algs.patch
Patch6: wpa_supplicant-gui-qt4.patch
# Need <unistd.h> for getopt
Patch7: wpa_supplicant-1.0-wpagui-getopt.patch
+Patch8: 0001-Fall-back-to-other-drivers-if-global-init-for-one-dr.patch
# Dirty hack for WiMAX
# http://linuxwimax.org/Download?action=AttachFile&do=get&target=wpa-1.5-README.txt
Patch100: wpa_supplicant-0.7.2-generate-libeap-peer.patch
@@ -90,7 +93,7 @@ This package contains header files for using the EAP peer library.
Don't use this unless you know what you're doing.
%prep
-%setup -q -n %{name}-%{version}-rc1
+%setup -q -n %{name}-%{version}%{rcver}
%patch0 -p1 -b .assoc-timeout
%patch1 -p1 -b .flush-debug-output
%patch2 -p1 -b .dbus-service-file
@@ -99,6 +102,7 @@ Don't use this unless you know what you're doing.
%patch5 -p1 -b .more-openssl-algs
%patch6 -p1 -b .qt4
%patch7 -p1 -b .getopt
+%patch8 -p1 -b .drv-fallback
%build
pushd wpa_supplicant
@@ -223,6 +227,9 @@ fi
%postun -n libeap -p /sbin/ldconfig
%changelog
+* Thu Feb 2 2012 Dan Williams <dcbw at redhat.com> - 1:1.0-0.2
+- Fix driver fallback for non nl80211-based drivers (rh #783712)
+
* Tue Jan 10 2012 Dan Williams <dcbw at redhat.com> - 1:1.0-0.1
- Update to 1.0-rc1 + git
More information about the scm-commits
mailing list