aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvestre Gallon <ccna.syl@gmail.com>2012-01-28 15:57:48 (GMT)
committerJouni Malinen <j@w1.fi>2012-01-28 15:57:48 (GMT)
commit3d0a843823a05b159eeaa47b59f9e4ec66e74a8f (patch)
tree7cb354e6fe17016f132b7b54c82cc1d5af3c74b6
parent6897ce14a41c30460c75fe06232f1bb91695c6ae (diff)
downloadhostap-3d0a843823a05b159eeaa47b59f9e4ec66e74a8f.zip
hostap-3d0a843823a05b159eeaa47b59f9e4ec66e74a8f.tar.gz
hostap-3d0a843823a05b159eeaa47b59f9e4ec66e74a8f.tar.bz2
dbus: Fix endianness bug in Frequency and Signal properties
These properties did not work on big endian PowerPC (always 100% for Signal and 0 for Frequency) due to endianness problem (u32 to u16 data loss). Signed-off-by: Sylvestre Gallon <ccna.syl@gmail.com>
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index cefad7c..621653f 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -2867,13 +2867,15 @@ dbus_bool_t wpas_dbus_getter_bss_signal(DBusMessageIter *iter,
{
struct bss_handler_args *args = user_data;
struct wpa_bss *res;
+ s16 level;
res = get_bss_helper(args, error, __func__);
if (!res)
return FALSE;
+ level = (s16) res->level;
return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_INT16,
- &res->level, error);
+ &level, error);
}
@@ -2891,13 +2893,15 @@ dbus_bool_t wpas_dbus_getter_bss_frequency(DBusMessageIter *iter,
{
struct bss_handler_args *args = user_data;
struct wpa_bss *res;
+ u16 freq;
res = get_bss_helper(args, error, __func__);
if (!res)
return FALSE;
+ freq = (u16) res->freq;
return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT16,
- &res->freq, error);
+ &freq, error);
}