aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus/dbus_new_handlers.c
diff options
context:
space:
mode:
authorFloris Bos <bos@je-eigen-domein.nl>2015-04-11 00:11:46 (GMT)
committerJouni Malinen <j@w1.fi>2015-04-13 12:08:46 (GMT)
commit8e2c5f1a2049bf2cd76f04977b52ca7f7f7ea4ec (patch)
tree889ed274e8d267893ce696b0dd5d499470097a7e /wpa_supplicant/dbus/dbus_new_handlers.c
parentd447cd596f0a9f73850229e7fa2bdd35755dc750 (diff)
downloadhostap-8e2c5f1a2049bf2cd76f04977b52ca7f7f7ea4ec.zip
hostap-8e2c5f1a2049bf2cd76f04977b52ca7f7f7ea4ec.tar.gz
hostap-8e2c5f1a2049bf2cd76f04977b52ca7f7f7ea4ec.tar.bz2
dbus: Fix WPS property of fi.w1.wpa_supplicant1.BSS interface
The dbus interface documentation says the following about the WPS property of the fi.w1.wpa_supplicant1.BSS interface: == WPS information of the BSS. Empty dictionary indicates no WPS support. Dictionary entries are: Type s "pbc", "pin", "" == However the implementation returns "type" => "" for BSSes that do not support WPS. Fix the implementation to match the documentation. Return empty dictionary if there is no WPS support. And "type" => "" if WPS is supported, but is not in progress right now. Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
Diffstat (limited to 'wpa_supplicant/dbus/dbus_new_handlers.c')
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index f2e62ca..66ee32f 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -3791,6 +3791,7 @@ dbus_bool_t wpas_dbus_getter_bss_wps(DBusMessageIter *iter, DBusError *error,
struct wpabuf *wps_ie;
#endif /* CONFIG_WPS */
DBusMessageIter iter_dict, variant_iter;
+ int wps_support = 0;
const char *type = "";
res = get_bss_helper(args, error, __func__);
@@ -3805,6 +3806,7 @@ dbus_bool_t wpas_dbus_getter_bss_wps(DBusMessageIter *iter, DBusError *error,
#ifdef CONFIG_WPS
wps_ie = wpa_bss_get_vendor_ie_multi(res, WPS_IE_VENDOR_TYPE);
if (wps_ie) {
+ wps_support = 1;
if (wps_is_selected_pbc_registrar(wps_ie))
type = "pbc";
else if (wps_is_selected_pin_registrar(wps_ie))
@@ -3814,7 +3816,7 @@ dbus_bool_t wpas_dbus_getter_bss_wps(DBusMessageIter *iter, DBusError *error,
}
#endif /* CONFIG_WPS */
- if (!wpa_dbus_dict_append_string(&iter_dict, "Type", type) ||
+ if ((wps_support && !wpa_dbus_dict_append_string(&iter_dict, "Type", type)) ||
!wpa_dbus_dict_close_write(&variant_iter, &iter_dict) ||
!dbus_message_iter_close_container(iter, &variant_iter))
goto nomem;