diff options
Diffstat (limited to 'wpa_supplicant')
| -rw-r--r-- | wpa_supplicant/bss.c | 3 | ||||
| -rw-r--r-- | wpa_supplicant/config_file.c | 12 | ||||
| -rw-r--r-- | wpa_supplicant/events.c | 8 | ||||
| -rw-r--r-- | wpa_supplicant/p2p_supplicant.c | 9 |
4 files changed, 22 insertions, 10 deletions
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c index 482fc64f..f99a8a71 100644 --- a/wpa_supplicant/bss.c +++ b/wpa_supplicant/bss.c @@ -674,7 +674,8 @@ void wpa_bss_update_scan_res(struct wpa_supplicant *wpa_s, wpa_s->last_scan_res_size = siz; } - wpa_s->last_scan_res[wpa_s->last_scan_res_used++] = bss; + if (wpa_s->last_scan_res) + wpa_s->last_scan_res[wpa_s->last_scan_res_used++] = bss; } diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index 8d59f496..38429467 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -352,8 +352,8 @@ struct wpa_config * wpa_config_read(const char *name, struct wpa_config *cfgp) FILE *f; char buf[512], *pos; int errors = 0, line = 0; - struct wpa_ssid *ssid, *tail = NULL, *head = NULL; - struct wpa_cred *cred, *cred_tail = NULL, *cred_head = NULL; + struct wpa_ssid *ssid, *tail, *head; + struct wpa_cred *cred, *cred_tail, *cred_head; struct wpa_config *config; int id = 0; int cred_id = 0; @@ -369,8 +369,12 @@ struct wpa_config * wpa_config_read(const char *name, struct wpa_config *cfgp) "structure"); return NULL; } - head = config->ssid; - cred_head = config->cred; + tail = head = config->ssid; + while (tail && tail->next) + tail = tail->next; + cred_tail = cred_head = config->cred; + while (cred_tail && cred_tail->next) + cred_tail = cred_tail->next; wpa_printf(MSG_DEBUG, "Reading configuration file '%s'", name); f = fopen(name, "r"); diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 7eedd837..9b7323bb 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -3366,6 +3366,14 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, } #endif /* CONFIG_P2P */ + if (wpa_s->wpa_state >= WPA_AUTHENTICATING) { + /* + * Indicate disconnection to keep ctrl_iface events + * consistent. + */ + wpa_supplicant_event_disassoc( + wpa_s, WLAN_REASON_DEAUTH_LEAVING, 1); + } wpa_supplicant_mark_disassoc(wpa_s); radio_remove_works(wpa_s, NULL, 0); diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 49b2cd28..522d277a 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -6781,7 +6781,7 @@ void wpas_p2p_new_psk_cb(struct wpa_supplicant *wpa_s, const u8 *mac_addr, { struct wpa_ssid *ssid = wpa_s->current_ssid; struct wpa_ssid *persistent; - struct psk_list_entry *p; + struct psk_list_entry *p, *last; if (psk_len != sizeof(p->psk)) return; @@ -6841,10 +6841,9 @@ void wpas_p2p_new_psk_cb(struct wpa_supplicant *wpa_s, const u8 *mac_addr, } os_memcpy(p->psk, psk, psk_len); - if (dl_list_len(&persistent->psk_list) > P2P_MAX_STORED_CLIENTS) { - struct psk_list_entry *last; - last = dl_list_last(&persistent->psk_list, - struct psk_list_entry, list); + if (dl_list_len(&persistent->psk_list) > P2P_MAX_STORED_CLIENTS && + (last = dl_list_last(&persistent->psk_list, + struct psk_list_entry, list))) { wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Remove oldest PSK entry for " MACSTR " (p2p=%u) to make room for a new one", MAC2STR(last->addr), last->p2p); |
