{
u8 key[32];
size_t keylen;
- wpa_alg alg;
+ enum wpa_alg alg;
u8 seq[6] = { 0 };
/* IBSS/WPA-None uses only one key (Group) for both receiving and
* @state: State (wpa_state; WPA_*)
* Returns: The state name as a printable text string
*/
-const char * wpa_supplicant_state_txt(int state)
+const char * wpa_supplicant_state_txt(enum wpa_states state)
{
switch (state) {
case WPA_DISCONNECTED:
* This function is called whenever the connection state changes, e.g.,
* association is completed for WPA/WPA2 4-Way Handshake is started.
*/
-void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, wpa_states state)
+void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
+ enum wpa_states state)
{
wpa_printf(MSG_DEBUG, "State: %s -> %s",
wpa_supplicant_state_txt(wpa_s->wpa_state),
}
+void wpa_supplicant_terminate_proc(struct wpa_global *global)
+{
+ int pending = 0;
+#ifdef CONFIG_WPS
+ struct wpa_supplicant *wpa_s = global->ifaces;
+ while (wpa_s) {
+ if (wpas_wps_terminate_pending(wpa_s) == 1)
+ pending = 1;
+ wpa_s = wpa_s->next;
+ }
+#endif /* CONFIG_WPS */
+ if (pending)
+ return;
+ eloop_terminate();
+}
+
+
static void wpa_supplicant_terminate(int sig, void *signal_ctx)
{
struct wpa_global *global = signal_ctx;
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING "- signal %d "
"received", sig);
}
- eloop_terminate();
+ wpa_supplicant_terminate_proc(global);
}
static void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s)
{
- wpa_states old_state = wpa_s->wpa_state;
+ enum wpa_states old_state = wpa_s->wpa_state;
wpa_s->pairwise_cipher = 0;
wpa_s->group_cipher = 0;
wpa_s->mgmt_group_cipher = 0;
wpa_printf(MSG_DEBUG, "Signal %d received - reconfiguring", sig);
for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
if (wpa_supplicant_reload_configuration(wpa_s) < 0) {
- eloop_terminate();
+ wpa_supplicant_terminate_proc(global);
}
}
}
-static wpa_cipher cipher_suite2driver(int cipher)
+static enum wpa_cipher cipher_suite2driver(int cipher)
{
switch (cipher) {
case WPA_CIPHER_NONE:
}
-static wpa_key_mgmt key_mgmt2driver(int key_mgmt)
+static enum wpa_key_mgmt key_mgmt2driver(int key_mgmt)
{
switch (key_mgmt) {
case WPA_KEY_MGMT_NONE:
size_t wpa_ie_len;
int use_crypt, ret, i, bssid_changed;
int algs = AUTH_ALG_OPEN_SYSTEM;
- wpa_cipher cipher_pairwise, cipher_group;
+ enum wpa_cipher cipher_pairwise, cipher_group;
struct wpa_driver_associate_params params;
int wep_keys_set = 0;
struct wpa_driver_capa capa;
wpa_s->drv_priv = wpa_drv_init(wpa_s, wpa_s->ifname);
if (wpa_s->drv_priv == NULL) {
const char *pos;
- pos = os_strchr(driver, ',');
+ pos = driver ? os_strchr(driver, ',') : NULL;
if (pos) {
wpa_printf(MSG_DEBUG, "Failed to initialize driver "
"interface - try next driver wrapper");