mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
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>
This commit is contained in:
parent
6897ce14a4
commit
3d0a843823
@ -2867,13 +2867,15 @@ dbus_bool_t wpas_dbus_getter_bss_signal(DBusMessageIter *iter,
|
|||||||
{
|
{
|
||||||
struct bss_handler_args *args = user_data;
|
struct bss_handler_args *args = user_data;
|
||||||
struct wpa_bss *res;
|
struct wpa_bss *res;
|
||||||
|
s16 level;
|
||||||
|
|
||||||
res = get_bss_helper(args, error, __func__);
|
res = get_bss_helper(args, error, __func__);
|
||||||
if (!res)
|
if (!res)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
level = (s16) res->level;
|
||||||
return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_INT16,
|
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 bss_handler_args *args = user_data;
|
||||||
struct wpa_bss *res;
|
struct wpa_bss *res;
|
||||||
|
u16 freq;
|
||||||
|
|
||||||
res = get_bss_helper(args, error, __func__);
|
res = get_bss_helper(args, error, __func__);
|
||||||
if (!res)
|
if (!res)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
freq = (u16) res->freq;
|
||||||
return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT16,
|
return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT16,
|
||||||
&res->freq, error);
|
&freq, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user