aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wpa_supplicant/config.c1
-rw-r--r--wpa_supplicant/config.h8
-rw-r--r--wpa_supplicant/config_file.c3
-rw-r--r--wpa_supplicant/wpa_cli.c2
-rw-r--r--wpa_supplicant/wpa_supplicant.conf5
-rw-r--r--wpa_supplicant/wps_supplicant.c4
6 files changed, 22 insertions, 1 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index e1f4883..2fe032d 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -4225,6 +4225,7 @@ static const struct global_parse_data global_fields[] = {
{ INT(key_mgmt_offload), 0},
{ INT(passive_scan), 0 },
{ INT(reassoc_same_bss_optim), 0 },
+ { INT(wps_priority), 0},
};
#undef FUNC
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index 16681fd..545a4bd 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -1164,6 +1164,14 @@ struct wpa_config {
* reassoc_same_bss_optim - Whether to optimize reassoc-to-same-BSS
*/
int reassoc_same_bss_optim;
+
+ /**
+ * wps_priority - Priority for the networks added through WPS
+ *
+ * This priority value will be set to each network profile that is added
+ * by executing the WPS protocol.
+ */
+ int wps_priority;
};
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index 781f5e5..2508ca9 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -1286,6 +1286,9 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
if (config->reassoc_same_bss_optim)
fprintf(f, "reassoc_same_bss_optim=%d\n",
config->reassoc_same_bss_optim);
+
+ if (config->wps_priority)
+ fprintf(f, "wps_priority=%d\n", config->wps_priority);
}
#endif /* CONFIG_NO_CONFIG_WRITE */
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index bd5846b..97e575c 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -662,7 +662,7 @@ static char ** wpa_cli_complete_set(const char *str, int pos)
"tdls_external_control", "osu_dir", "wowlan_triggers",
"p2p_search_delay", "mac_addr", "rand_addr_lifetime",
"preassoc_mac_addr", "key_mgmt_offload", "passive_scan",
- "reassoc_same_bss_optim"
+ "reassoc_same_bss_optim", "wps_priority"
};
int i, num_fields = ARRAY_SIZE(fields);
diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf
index c1bcbd4..d380965 100644
--- a/wpa_supplicant/wpa_supplicant.conf
+++ b/wpa_supplicant/wpa_supplicant.conf
@@ -268,6 +268,11 @@ fast_reauth=1
#wps_nfc_dh_privkey: Hexdump of DH Private Key
#wps_nfc_dev_pw: Hexdump of Device Password
+# Priority for the networks added through WPS
+# This priority value will be set to each network profile that is added
+# by executing the WPS protocol.
+#wps_priority=0
+
# Maximum number of BSS entries to keep in memory
# Default: 200
# This can be used to limit memory use on the BSS entries (cached scan
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 61a8587..a97c2a8 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -547,6 +547,7 @@ static int wpa_supplicant_wps_cred(void *ctx,
return -1;
}
}
+ ssid->priority = wpa_s->conf->wps_priority;
wpas_wps_security_workaround(wpa_s, ssid, cred);
@@ -560,6 +561,9 @@ static int wpa_supplicant_wps_cred(void *ctx,
}
#endif /* CONFIG_NO_CONFIG_WRITE */
+ if (ssid->priority)
+ wpa_config_update_prio_list(wpa_s->conf);
+
/*
* Optimize the post-WPS scan based on the channel used during
* the provisioning in case EAP-Failure is not received.