Add options in hostapd to inject connection failures.
Add hostapd_cli set commands for skip_send_eapol and enable_eapol_large_timeout.
1) with skip_send_eapol=1, AP won't send m0/m2 frames.
2) with enable_eapol_large_timeout=1, AP will time out 50 seconds after m0 or m2.
These two flags can also be set in hostapd.conf. By default, both are
set to 0.
With skip_send_eapol=1 and enable_eapol_large_timeout=0, AP will deauthenticate STA during 4-way handshake.
With skip_send_eapol=1 and enable_eapol_large_timeout=1, STA will hit auth timeout.
Bug: 174201865
Test: manual test with hostapd_cli set commands and check if STA hits
the above connection failures.
Change-Id: I3df1ab11a54b81254ce7efdd6c5e4d95a9314ddc
diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h
index 5f9df9c..ff90464 100644
--- a/src/ap/wpa_auth.h
+++ b/src/ap/wpa_auth.h
@@ -240,6 +240,8 @@
unsigned int gtk_rsc_override_set:1;
unsigned int igtk_rsc_override_set:1;
int ft_rsnxe_used;
+ unsigned int skip_send_eapol:1;
+ unsigned int enable_eapol_large_timeout:1;
#endif /* CONFIG_TESTING_OPTIONS */
unsigned int oci_freq_override_eapol_m3;
unsigned int oci_freq_override_eapol_g1;
@@ -542,5 +544,9 @@
void wpa_auth_set_ocv_override_freq(struct wpa_authenticator *wpa_auth,
enum wpa_auth_ocv_override_frame frame,
unsigned int freq);
+void wpa_auth_set_skip_send_eapol(struct wpa_authenticator *wpa_auth,
+ u8 val);
+void wpa_auth_set_enable_eapol_large_timeout(struct wpa_authenticator *wpa_auth,
+ u8 val);
#endif /* WPA_AUTH_H */