Accumulative patch from commit 97279d8d1ad40bd7d884af8e2fc26dff0163331a

97279d8 nl80211: Drop frame events that are for foreign address
cc2ada8 nl80211: Reduce debug on Probe Request frames
63a965c P2P: Fix after_scan_tx processing during ongoing operations
06b7f58 RSN: Update preauth scan results only based on new scan results
18e00b5 Move wpa_s freeing into wpa_supplicant_deinit_iface()
754632c dbus_new: Add EAP logon/logoff
c2aff6b hostapd: Add some testing options
adc96dc nl80211: Fix nla_nest_start conversion
0606052 wpa_supplicant: Add get_capability freq
c7a39ba Provide TLS alerts to CLI/UI over control interface
2a07a27 P2P: Increase GTK rekeying period to 24 hours
75fa7d1 TDLS: Fix key configuration with current mac80211
8970bae nl80211: Use nla_nest_start/end instead of nla_put_nested

Change-Id: Ic4b568c341657d266b7759513230d4ef206d75b1
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 8baa15e..7bef55f 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -557,6 +557,16 @@
 		return;
 	}
 
+#ifdef CONFIG_TESTING_OPTIONS
+	if (hapd->iconf->ignore_auth_probability > 0.0d &&
+	    drand48() < hapd->iconf->ignore_auth_probability) {
+		wpa_printf(MSG_INFO,
+			   "TESTING: ignoring auth frame from " MACSTR,
+			   MAC2STR(mgmt->sa));
+		return;
+	}
+#endif /* CONFIG_TESTING_OPTIONS */
+
 	auth_alg = le_to_host16(mgmt->u.auth.auth_alg);
 	auth_transaction = le_to_host16(mgmt->u.auth.auth_transaction);
 	status_code = le_to_host16(mgmt->u.auth.status_code);
@@ -1226,6 +1236,26 @@
 		return;
 	}
 
+#ifdef CONFIG_TESTING_OPTIONS
+	if (reassoc) {
+		if (hapd->iconf->ignore_reassoc_probability > 0.0d &&
+		    drand48() < hapd->iconf->ignore_reassoc_probability) {
+			wpa_printf(MSG_INFO,
+				   "TESTING: ignoring reassoc request from "
+				   MACSTR, MAC2STR(mgmt->sa));
+			return;
+		}
+	} else {
+		if (hapd->iconf->ignore_assoc_probability > 0.0d &&
+		    drand48() < hapd->iconf->ignore_assoc_probability) {
+			wpa_printf(MSG_INFO,
+				   "TESTING: ignoring assoc request from "
+				   MACSTR, MAC2STR(mgmt->sa));
+			return;
+		}
+	}
+#endif /* CONFIG_TESTING_OPTIONS */
+
 	if (reassoc) {
 		capab_info = le_to_host16(mgmt->u.reassoc_req.capab_info);
 		listen_interval = le_to_host16(