aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2008-02-16 18:05:19 (GMT)
committerJouni Malinen <j@w1.fi>2008-02-16 18:05:19 (GMT)
commit9bd80cf08831f20c0004adc21c72f13702a8aee4 (patch)
treef7120585061b305a18ac70b71d0000935203ad95
parent8e1103863c2dcfaa21c1b7be4f70c602c43efc3a (diff)
downloadhostap-history-9bd80cf08831f20c0004adc21c72f13702a8aee4.zip
hostap-history-9bd80cf08831f20c0004adc21c72f13702a8aee4.tar.gz
hostap-history-9bd80cf08831f20c0004adc21c72f13702a8aee4.tar.bz2
Fixed dbus scan result IE handlers
Note that this issue doesn't affect the stable branch, because there the parameters to wpa_dbus_dict_append_byte_array() are actually _arrays_, not pointers, and therefore the & operator performs as expected. There are two issues here: 1) The comment about D-Bus requiring the address of the variable is wrong, because wpa_dbus_dict_append_byte_array() handles all of that for you 2) Commit 3e4bd73d5382c5942c79df5b71aa0cd3f5b943d8 incorrectly changed the handling of these array values to pointers, keeping the & instead of dropping it when moving from u8[] to u8* Following patch is simpler and removes the erroneous comment.
-rw-r--r--wpa_supplicant/ctrl_iface_dbus_handlers.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/wpa_supplicant/ctrl_iface_dbus_handlers.c b/wpa_supplicant/ctrl_iface_dbus_handlers.c
index 7923d76..1735008 100644
--- a/wpa_supplicant/ctrl_iface_dbus_handlers.c
+++ b/wpa_supplicant/ctrl_iface_dbus_handlers.c
@@ -379,15 +379,8 @@ DBusMessage * wpas_dbus_bssid_properties(DBusMessage *message,
struct wpa_scan_res *res)
{
DBusMessage *reply = NULL;
- char *bssid_data;
DBusMessageIter iter, iter_dict;
const u8 *ie;
- size_t len;
-
- /* dbus needs the address of a pointer to the actual value
- * for array types, not the address of the value itself.
- */
- bssid_data = (char *) &res->bssid;
/* Dump the properties into a dbus message */
reply = dbus_message_new_method_return(message);
@@ -397,37 +390,31 @@ DBusMessage * wpas_dbus_bssid_properties(DBusMessage *message,
goto error;
if (!wpa_dbus_dict_append_byte_array(&iter_dict, "bssid",
- bssid_data, ETH_ALEN))
+ (const char *) res->bssid,
+ ETH_ALEN))
goto error;
ie = wpa_scan_get_ie(res, WLAN_EID_SSID);
if (ie) {
- const char *ssid_data;
- len = ie[1];
- ie += 2;
- ssid_data = (const char *) &ie;
if (!wpa_dbus_dict_append_byte_array(&iter_dict, "ssid",
- ssid_data, len))
+ (const char *) (ie + 2),
+ ie[1]))
goto error;
}
ie = wpa_scan_get_vendor_ie(res, WPA_IE_VENDOR_TYPE);
if (ie) {
- const char *wpa_ie_data;
- len = 2 + ie[1];
- wpa_ie_data = (const char *) &ie;
if (!wpa_dbus_dict_append_byte_array(&iter_dict, "wpaie",
- wpa_ie_data, len))
+ (const char *) ie,
+ ie[1] + 2))
goto error;
}
ie = wpa_scan_get_ie(res, WLAN_EID_RSN);
if (ie) {
- const char *rsn_ie_data;
- len = 2 + ie[1];
- rsn_ie_data = (const char *) &ie;
if (!wpa_dbus_dict_append_byte_array(&iter_dict, "rsnie",
- rsn_ie_data, len))
+ (const char *) ie,
+ ie[1] + 2))
goto error;
}