From 20df9abfa069f9991916932f11b69f1cc2bec441 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Mon, 21 Jan 2013 02:44:57 +0100 Subject: [PATCH] wpa_supplicant: update to wpa_supplicant-2.0 Signed-off-by: Stephan Raue --- packages/network/wpa_supplicant/meta | 2 +- .../wpa_supplicant-1.1-assoc-timeout.patch | 16 ---- ...upplicant-1.1-dbus-service-file-args.patch | 20 ---- ...pa_supplicant-1.1-flush-debug-output.patch | 49 ---------- .../wpa_supplicant-1.1-libnl3-includes.patch | 12 --- ...wpa_supplicant-1.1-openssl-more-algs.patch | 16 ---- ...icant-1.1-quiet-scan-results-message.patch | 13 --- ...t-1.1-squelch-driver-disconnect-spam.patch | 96 ------------------- .../wpa_supplicant-2.0-libnl3-includes.patch | 24 +++++ 9 files changed, 25 insertions(+), 223 deletions(-) delete mode 100644 packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-assoc-timeout.patch delete mode 100644 packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-dbus-service-file-args.patch delete mode 100644 packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-flush-debug-output.patch delete mode 100644 packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-libnl3-includes.patch delete mode 100644 packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-openssl-more-algs.patch delete mode 100644 packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-quiet-scan-results-message.patch delete mode 100644 packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-squelch-driver-disconnect-spam.patch create mode 100644 packages/network/wpa_supplicant/patches/wpa_supplicant-2.0-libnl3-includes.patch diff --git a/packages/network/wpa_supplicant/meta b/packages/network/wpa_supplicant/meta index 72ea4ff238..28900a8828 100644 --- a/packages/network/wpa_supplicant/meta +++ b/packages/network/wpa_supplicant/meta @@ -19,7 +19,7 @@ ################################################################################ PKG_NAME="wpa_supplicant" -PKG_VERSION="1.1" +PKG_VERSION="2.0" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-assoc-timeout.patch b/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-assoc-timeout.patch deleted file mode 100644 index c3b3568c6b..0000000000 --- a/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-assoc-timeout.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -up wpa_supplicant-0.7.3/wpa_supplicant/wpa_supplicant.c.assoc-timeout wpa_supplicant-0.7.3/wpa_supplicant/wpa_supplicant.c ---- wpa_supplicant-0.7.3/wpa_supplicant/wpa_supplicant.c.assoc-timeout 2010-09-07 10:43:39.000000000 -0500 -+++ wpa_supplicant-0.7.3/wpa_supplicant/wpa_supplicant.c 2010-12-07 18:57:45.163457000 -0600 -@@ -1262,10 +1262,10 @@ void wpa_supplicant_associate(struct wpa - - if (assoc_failed) { - /* give IBSS a bit more time */ -- timeout = ssid->mode == WPAS_MODE_IBSS ? 10 : 5; -+ timeout = ssid->mode == WPAS_MODE_IBSS ? 20 : 10; - } else if (wpa_s->conf->ap_scan == 1) { - /* give IBSS a bit more time */ -- timeout = ssid->mode == WPAS_MODE_IBSS ? 20 : 10; -+ timeout = ssid->mode == WPAS_MODE_IBSS ? 20 : 20; - } - wpa_supplicant_req_auth_timeout(wpa_s, timeout, 0); - } diff --git a/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-dbus-service-file-args.patch b/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-dbus-service-file-args.patch deleted file mode 100644 index b7478dad83..0000000000 --- a/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-dbus-service-file-args.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -up wpa_supplicant-0.7.3/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in.fedora wpa_supplicant-0.7.3/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in ---- wpa_supplicant-0.7.3/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in.fedora 2008-03-02 20:58:35.000000000 -0500 -+++ wpa_supplicant-0.7.3/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in 2008-03-02 20:58:41.000000000 -0500 -@@ -1,5 +1,5 @@ - [D-BUS Service] - Name=fi.w1.wpa_supplicant1 --Exec=@BINDIR@/wpa_supplicant -u -+Exec=@BINDIR@/wpa_supplicant -B -u -f /var/log/wpa_supplicant.log -c /etc/wpa_supplicant/wpa_supplicant.conf -P /var/run/wpa_supplicant.pid - User=root - SystemdService=wpa_supplicant.service -diff -up wpa_supplicant-0.7.3/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in.fedora wpa_supplicant-0.7.3/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in ---- wpa_supplicant-0.7.3/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in.fedora 2008-03-02 20:58:35.000000000 -0500 -+++ wpa_supplicant-0.7.3/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in 2008-03-02 20:58:41.000000000 -0500 -@@ -1,5 +1,5 @@ - [D-BUS Service] - Name=fi.epitest.hostap.WPASupplicant --Exec=@BINDIR@/wpa_supplicant -u -+Exec=@BINDIR@/wpa_supplicant -B -u -f /var/log/wpa_supplicant.log -c /etc/wpa_supplicant/wpa_supplicant.conf -P /var/run/wpa_supplicant.pid - User=root - SystemdService=wpa_supplicant.service diff --git a/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-flush-debug-output.patch b/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-flush-debug-output.patch deleted file mode 100644 index a686851867..0000000000 --- a/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-flush-debug-output.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- wpa_supplicant-0.6.3/src/utils/wpa_debug.c.flush-debug 2007-07-30 23:15:34.000000000 -0400 -+++ wpa_supplicant-0.6.3/src/utils/wpa_debug.c 2007-07-30 23:17:06.000000000 -0400 -@@ -157,6 +157,7 @@ void wpa_debug_print_timestamp(void) - if (out_file) { - fprintf(out_file, "%ld.%06u: ", (long) tv.sec, - (unsigned int) tv.usec); -+ fflush(out_file); - } else - #endif /* CONFIG_DEBUG_FILE */ - printf("%ld.%06u: ", (long) tv.sec, (unsigned int) tv.usec); -@@ -185,6 +186,7 @@ void wpa_printf(int level, char *fmt, .. - if (out_file) { - vfprintf(out_file, fmt, ap); - fprintf(out_file, "\n"); -+ fflush(out_file); - } else { - #endif /* CONFIG_DEBUG_FILE */ - vprintf(fmt, ap); -@@ -217,6 +219,7 @@ static void _wpa_hexdump(int level, cons - fprintf(out_file, " [REMOVED]"); - } - fprintf(out_file, "\n"); -+ fflush(out_file); - } else { - #endif /* CONFIG_DEBUG_FILE */ - printf("%s - hexdump(len=%lu):", title, (unsigned long) len); -@@ -262,12 +265,14 @@ static void _wpa_hexdump_ascii(int level - fprintf(out_file, - "%s - hexdump_ascii(len=%lu): [REMOVED]\n", - title, (unsigned long) len); -+ fflush(out_file); - return; - } - if (buf == NULL) { - fprintf(out_file, - "%s - hexdump_ascii(len=%lu): [NULL]\n", - title, (unsigned long) len); -+ fflush(out_file); - return; - } - fprintf(out_file, "%s - hexdump_ascii(len=%lu):\n", -@@ -292,6 +297,7 @@ static void _wpa_hexdump_ascii(int level - pos += llen; - len -= llen; - } -+ fflush(out_file); - } else { - #endif /* CONFIG_DEBUG_FILE */ - if (!show) { diff --git a/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-libnl3-includes.patch b/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-libnl3-includes.patch deleted file mode 100644 index 5d8903906a..0000000000 --- a/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-libnl3-includes.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up wpa_supplicant-1.0-rc2/src/drivers/drivers.mak.foo wpa_supplicant-1.0-rc2/src/drivers/drivers.mak ---- wpa_supplicant-1.0-rc2/src/drivers/drivers.mak.foo 2012-03-02 16:11:43.176448714 -0600 -+++ wpa_supplicant-1.0-rc2/src/drivers/drivers.mak 2012-03-02 16:12:29.759866341 -0600 -@@ -48,7 +48,7 @@ NEED_RFKILL=y - ifdef CONFIG_LIBNL32 - DRV_LIBS += -lnl-3 - DRV_LIBS += -lnl-genl-3 -- DRV_CFLAGS += -DCONFIG_LIBNL20 -+ DRV_CFLAGS += -DCONFIG_LIBNL20 `pkg-config --cflags libnl-3.0` - else - ifdef CONFIG_LIBNL_TINY - DRV_LIBS += -lnl-tiny diff --git a/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-openssl-more-algs.patch b/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-openssl-more-algs.patch deleted file mode 100644 index b44c463c53..0000000000 --- a/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-openssl-more-algs.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -up wpa_supplicant-0.7.3/src/crypto/tls_openssl.c.more-openssl-algs wpa_supplicant-0.7.3/src/crypto/tls_openssl.c ---- wpa_supplicant-0.7.3/src/crypto/tls_openssl.c.more-openssl-algs 2010-09-07 10:43:39.000000000 -0500 -+++ wpa_supplicant-0.7.3/src/crypto/tls_openssl.c 2010-12-08 10:01:02.967664004 -0600 -@@ -710,6 +710,11 @@ void * tls_init(const struct tls_config - #endif /* OPENSSL_FIPS */ - #endif /* CONFIG_FIPS */ - SSL_load_error_strings(); -+ /* Only add potentially weak hashes and encryption algorithms -+ * when FIPS mode is not enabled. -+ */ -+ if (!conf || !conf->fips_mode) -+ OpenSSL_add_all_algorithms(); - SSL_library_init(); - #if (OPENSSL_VERSION_NUMBER >= 0x0090800fL) && !defined(OPENSSL_NO_SHA256) - EVP_add_digest(EVP_sha256()); - diff --git a/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-quiet-scan-results-message.patch b/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-quiet-scan-results-message.patch deleted file mode 100644 index 5bb36a49c3..0000000000 --- a/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-quiet-scan-results-message.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up wpa_supplicant-0.6.7/wpa_supplicant/events.c.scan-results-msg wpa_supplicant-0.6.7/wpa_supplicant/events.c ---- wpa_supplicant-0.6.7/wpa_supplicant/events.c.scan-results-msg 2009-01-30 12:08:34.000000000 -0500 -+++ wpa_supplicant-0.6.7/wpa_supplicant/events.c 2009-01-30 12:08:37.000000000 -0500 -@@ -911,7 +911,7 @@ static void wpa_supplicant_event_scan_re - } - - wpa_dbg(wpa_s, MSG_DEBUG, "New scan results available"); -- wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS); -+ wpa_msg_ctrl(wpa_s, MSG_DEBUG, WPA_EVENT_SCAN_RESULTS); - wpas_notify_scan_results(wpa_s); - - wpas_notify_scan_done(wpa_s, 1); - diff --git a/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-squelch-driver-disconnect-spam.patch b/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-squelch-driver-disconnect-spam.patch deleted file mode 100644 index f53a41829c..0000000000 --- a/packages/network/wpa_supplicant/patches/wpa_supplicant-1.1-squelch-driver-disconnect-spam.patch +++ /dev/null @@ -1,96 +0,0 @@ -diff -up wpa_supplicant-0.6.8/wpa_supplicant/events.c.disconnect-spam wpa_supplicant-0.6.8/wpa_supplicant/events.c ---- wpa_supplicant-0.6.8/wpa_supplicant/events.c.disconnect-spam 2010-05-06 18:10:51.348288705 -0700 -+++ wpa_supplicant-0.6.8/wpa_supplicant/events.c 2010-05-06 18:10:51.356288887 -0700 -@@ -1302,6 +1302,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); - - if (authenticating && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)) -diff -up wpa_supplicant-0.6.8/wpa_supplicant/wpa_supplicant.c.disconnect-spam wpa_supplicant-0.6.8/wpa_supplicant/wpa_supplicant.c ---- wpa_supplicant-0.6.8/wpa_supplicant/wpa_supplicant.c.disconnect-spam 2010-05-06 18:10:51.340288662 -0700 -+++ wpa_supplicant-0.6.8/wpa_supplicant/wpa_supplicant.c 2010-05-06 18:12:06.090413976 -0700 -@@ -382,6 +382,9 @@ static void wpa_supplicant_cleanup(struc - - wpa_supplicant_cancel_scan(wpa_s); - wpa_supplicant_cancel_auth_timeout(wpa_s); -+ if (eloop_is_timeout_registered(wpa_disconnect_spam_handle, wpa_s, NULL)) -+ eloop_cancel_timeout(wpa_disconnect_spam_handle, wpa_s, NULL); -+ - eloop_cancel_timeout(wpa_supplicant_stop_countermeasures, wpa_s, NULL); - #ifdef CONFIG_DELAYED_MIC_ERROR_REPORT - eloop_cancel_timeout(wpa_supplicant_delayed_mic_error_report, -@@ -461,6 +464,23 @@ const char * wpa_supplicant_state_txt(in - #endif /* CONFIG_BGSCAN */ - - -+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 -@@ -478,6 +498,18 @@ void wpa_supplicant_set_state(struct wpa - if (state != WPA_SCANNING) - wpa_supplicant_notify_scanning(wpa_s, 0); - -+ 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.8/wpa_supplicant/wpa_supplicant_i.h.disconnect-spam wpa_supplicant-0.6.8/wpa_supplicant/wpa_supplicant_i.h ---- wpa_supplicant-0.6.8/wpa_supplicant/wpa_supplicant_i.h.disconnect-spam 2009-02-15 10:00:00.000000000 -0800 -+++ wpa_supplicant-0.6.8/wpa_supplicant/wpa_supplicant_i.h 2010-05-06 18:10:51.358288792 -0700 -@@ -397,6 +397,8 @@ struct wpa_supplicant { - int wps_success; /* WPS success event received */ - struct wps_er *wps_er; - int blacklist_cleared; -+ -+ int disconnect_count; - - struct wpabuf *pending_eapol_rx; - struct os_time pending_eapol_rx_time; -@@ -461,6 +463,7 @@ void wpa_clear_keys(struct wpa_supplican - int sec, int usec); - void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, - enum 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); - const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s); - void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s); - diff --git a/packages/network/wpa_supplicant/patches/wpa_supplicant-2.0-libnl3-includes.patch b/packages/network/wpa_supplicant/patches/wpa_supplicant-2.0-libnl3-includes.patch new file mode 100644 index 0000000000..bd9309bd21 --- /dev/null +++ b/packages/network/wpa_supplicant/patches/wpa_supplicant-2.0-libnl3-includes.patch @@ -0,0 +1,24 @@ +diff -Naur wpa_supplicant-2.0/src/drivers/drivers.mak wpa_supplicant-2.0.patch/src/drivers/drivers.mak +--- wpa_supplicant-2.0/src/drivers/drivers.mak 2013-01-12 16:42:53.000000000 +0100 ++++ wpa_supplicant-2.0.patch/src/drivers/drivers.mak 2013-01-21 02:15:18.034917696 +0100 +@@ -30,7 +30,7 @@ + ifdef CONFIG_LIBNL32 + DRV_LIBS += -lnl-3 + DRV_LIBS += -lnl-genl-3 +- DRV_CFLAGS += -DCONFIG_LIBNL20 -I/usr/include/libnl3 ++ DRV_CFLAGS += -DCONFIG_LIBNL20 `pkg-config --cflags libnl-3.0` + else + ifdef CONFIG_LIBNL_TINY + DRV_LIBS += -lnl-tiny +diff -Naur wpa_supplicant-2.0/src/drivers/drivers.mk wpa_supplicant-2.0.patch/src/drivers/drivers.mk +--- wpa_supplicant-2.0/src/drivers/drivers.mk 2013-01-12 16:42:53.000000000 +0100 ++++ wpa_supplicant-2.0.patch/src/drivers/drivers.mk 2013-01-21 02:15:39.677784809 +0100 +@@ -30,7 +30,7 @@ + ifdef CONFIG_LIBNL32 + DRV_LIBS += -lnl-3 + DRV_LIBS += -lnl-genl-3 +- DRV_CFLAGS += -DCONFIG_LIBNL20 -I/usr/include/libnl3 ++ DRV_CFLAGS += -DCONFIG_LIBNL20 `pkg-config --cflags libnl-3.0` + else + ifdef CONFIG_LIBNL_TINY + DRV_LIBS += -lnl-tiny