summaryrefslogtreecommitdiffstats
path: root/source/n/wpa_supplicant/patches/squelch-driver-disconnect-spam.diff
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2012-09-26 01:10:42 +0000
committer Eric Hameleers <alien@slackware.com>2018-05-31 22:51:55 +0200
commit9664bee729d487bcc0a0bc35859f8e13d5421c75 (patch)
treeb428a16618e36ed864a8d76ea3435e19a452bf90 /source/n/wpa_supplicant/patches/squelch-driver-disconnect-spam.diff
parent75a4a592e5ccda30715f93563d741b83e0dcf39e (diff)
downloadcurrent-9664bee729d487bcc0a0bc35859f8e13d5421c75.tar.gz
current-9664bee729d487bcc0a0bc35859f8e13d5421c75.tar.xz
Slackware 14.0slackware-14.0
Wed Sep 26 01:10:42 UTC 2012 Slackware 14.0 x86_64 stable is released! We're perfectionists here at Slackware, so this release has been a long time a-brewing. But we think you'll agree that it was worth the wait. Slackware 14.0 combines modern components, ease of use, and flexible configuration... our "KISS" philosophy demands it. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. Thanks to everyone who helped make this happen. The Slackware team, the upstream developers, and (of course) the awesome Slackware user community. Have fun! :-)
Diffstat (limited to 'source/n/wpa_supplicant/patches/squelch-driver-disconnect-spam.diff')
-rw-r--r--source/n/wpa_supplicant/patches/squelch-driver-disconnect-spam.diff95
1 files changed, 95 insertions, 0 deletions
diff --git a/source/n/wpa_supplicant/patches/squelch-driver-disconnect-spam.diff b/source/n/wpa_supplicant/patches/squelch-driver-disconnect-spam.diff
new file mode 100644
index 000000000..b8d2be6ad
--- /dev/null
+++ b/source/n/wpa_supplicant/patches/squelch-driver-disconnect-spam.diff
@@ -0,0 +1,95 @@
+diff -Nur wpa_supplicant-1.0-rc3.orig/wpa_supplicant/events.c wpa_supplicant-1.0-rc3/wpa_supplicant/events.c
+--- wpa_supplicant-1.0-rc3.orig/wpa_supplicant/events.c 2012-04-16 15:15:40.000000000 -0500
++++ wpa_supplicant-1.0-rc3/wpa_supplicant/events.c 2012-05-06 01:01:17.529134316 -0500
+@@ -1593,6 +1593,15 @@
+ 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 -Nur wpa_supplicant-1.0-rc3.orig/wpa_supplicant/wpa_supplicant.c wpa_supplicant-1.0-rc3/wpa_supplicant/wpa_supplicant.c
+--- wpa_supplicant-1.0-rc3.orig/wpa_supplicant/wpa_supplicant.c 2012-04-16 15:15:40.000000000 -0500
++++ wpa_supplicant-1.0-rc3/wpa_supplicant/wpa_supplicant.c 2012-05-06 01:01:17.530134303 -0500
+@@ -434,6 +434,9 @@
+
+ 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,
+@@ -592,6 +595,23 @@
+ #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
+@@ -612,6 +632,18 @@
+ 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 -Nur wpa_supplicant-1.0-rc3.orig/wpa_supplicant/wpa_supplicant_i.h wpa_supplicant-1.0-rc3/wpa_supplicant/wpa_supplicant_i.h
+--- wpa_supplicant-1.0-rc3.orig/wpa_supplicant/wpa_supplicant_i.h 2012-04-16 15:15:40.000000000 -0500
++++ wpa_supplicant-1.0-rc3/wpa_supplicant/wpa_supplicant_i.h 2012-05-06 01:01:17.530134303 -0500
+@@ -355,6 +355,8 @@
+ struct wps_er *wps_er;
+ int blacklist_cleared;
+
++ int disconnect_count;
++
+ struct wpabuf *pending_eapol_rx;
+ struct os_time pending_eapol_rx_time;
+ u8 pending_eapol_rx_src[ETH_ALEN];
+@@ -535,6 +537,7 @@
+ 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);