summaryrefslogtreecommitdiff
path: root/gsupplicant
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-06-08 13:58:49 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-06-11 14:59:07 +0300
commit23da213b31cac162597b73438885ca756d11bafd (patch)
treee18ff46709295ecb6ddf9527bc0b06fca857fbe9 /gsupplicant
parent4b020fabffdaad0921f68841aaed558cc9ca1466 (diff)
downloadconnman-23da213b31cac162597b73438885ca756d11bafd.tar.gz
connman-23da213b31cac162597b73438885ca756d11bafd.tar.bz2
connman-23da213b31cac162597b73438885ca756d11bafd.zip
gsupplicant: Properly handle WPS properties update
Diffstat (limited to 'gsupplicant')
-rw-r--r--gsupplicant/supplicant.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 7659b1b7..decf5fae 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -1143,13 +1143,6 @@ static void add_or_replace_bss_to_network(struct g_supplicant_bss *bss)
network->frequency = bss->frequency;
network->best_bss = bss;
- network->wps = FALSE;
- if ((bss->keymgmt & G_SUPPLICANT_KEYMGMT_WPS) != 0) {
- network->wps = TRUE;
-
- network->wps_capabilities |= bss->wps_capabilities;
- }
-
SUPPLICANT_DBG("New network %s created", network->name);
network->bss_table = g_hash_table_new_full(g_str_hash, g_str_equal,
@@ -1164,6 +1157,12 @@ static void add_or_replace_bss_to_network(struct g_supplicant_bss *bss)
callback_network_added(network);
done:
+ /* We update network's WPS properties if only bss provides WPS. */
+ if ((bss->keymgmt & G_SUPPLICANT_KEYMGMT_WPS) != 0) {
+ network->wps = TRUE;
+ network->wps_capabilities |= bss->wps_capabilities;
+ }
+
if (bss->signal > network->signal) {
network->signal = bss->signal;
network->best_bss = bss;
@@ -1343,6 +1342,9 @@ static void bss_process_ies(DBusMessageIter *iter, void *user_data)
if (ie == NULL || ie_len < 2)
return;
+ bss->wps_capabilities = 0;
+ bss->keymgmt = 0;
+
for (ie_end = ie + ie_len; ie < ie_end && ie + ie[1] + 1 <= ie_end;
ie += ie[1] + 2) {