wpa_supplicant: Use unique IDs for networks and credentials
The id and cred_id variables are reset to 0 every time the
wpa_config_read() function is called, which is fine as long as it is
only called once. However, this is not the case when using both the -c
and -I options to specify two config files.
This is a problem because the GUI, since commit eadfeb0e93
("wpa_gui:
Show entire list of networks"), relies on the network IDs being unique
(and increasing), and might get into an infinite loop otherwise.
This is solved by simply making the variables static.
Signed-off-by: Naïm Favier <n@monade.li>
This commit is contained in:
parent
dacb6d278d
commit
0adc67612d
1 changed files with 2 additions and 2 deletions
|
@ -297,8 +297,8 @@ struct wpa_config * wpa_config_read(const char *name, struct wpa_config *cfgp)
|
|||
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;
|
||||
static int id = 0;
|
||||
static int cred_id = 0;
|
||||
|
||||
if (name == NULL)
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue