[pkg-wpa-devel] r1131 - /wpasupplicant/trunk/debian/patches/40_dbus_ssid_data.patch
kelmo-guest at users.alioth.debian.org
kelmo-guest at users.alioth.debian.org
Wed Feb 13 05:02:05 UTC 2008
Author: kelmo-guest
Date: Wed Feb 13 05:02:04 2008
New Revision: 1131
URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=1131
Log:
update debian/patches/40_dbus_ssid_data.patch with patch from upstream
Modified:
wpasupplicant/trunk/debian/patches/40_dbus_ssid_data.patch
Modified: wpasupplicant/trunk/debian/patches/40_dbus_ssid_data.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/40_dbus_ssid_data.patch?rev=1131&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/patches/40_dbus_ssid_data.patch (original)
+++ wpasupplicant/trunk/debian/patches/40_dbus_ssid_data.patch Wed Feb 13 05:02:04 2008
@@ -1,33 +1,79 @@
-From: Alban Browaeys <prahal at yahoo.com>
-Reference: http://lists.shmoo.com/pipermail/hostap/2008-February/017334.html
-Description: Send requested data from ie pointer, not garbage.
+From: Dan Williams <dcbw at redhat.com>
+Reference: http://lists.shmoo.com/pipermail/hostap/2008-February/017336.html
+Description: 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.
+---
--- a/wpa_supplicant/ctrl_iface_dbus_handlers.c
+++ b/wpa_supplicant/ctrl_iface_dbus_handlers.c
-@@ -405,7 +405,7 @@
- const char *ssid_data;
- len = ie[1];
- ie += 2;
+@@ -379,15 +379,8 @@
+ 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 @@
+ 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;
-+ ssid_data = (const char *) ie;
if (!wpa_dbus_dict_append_byte_array(&iter_dict, "ssid",
- ssid_data, len))
+- ssid_data, len))
++ (const char *) (ie + 2),
++ ie[1]))
goto error;
-@@ -415,7 +415,7 @@
+ }
+
+ ie = wpa_scan_get_vendor_ie(res, WPA_IE_VENDOR_TYPE);
if (ie) {
- const char *wpa_ie_data;
- len = 2 + ie[1];
+- const char *wpa_ie_data;
+- len = 2 + ie[1];
- wpa_ie_data = (const char *) &ie;
-+ wpa_ie_data = (const char *) ie;
if (!wpa_dbus_dict_append_byte_array(&iter_dict, "wpaie",
- wpa_ie_data, len))
+- wpa_ie_data, len))
++ (const char *) ie,
++ ie[1] + 2))
goto error;
-@@ -425,7 +425,7 @@
+ }
+
+ ie = wpa_scan_get_ie(res, WLAN_EID_RSN);
if (ie) {
- const char *rsn_ie_data;
- len = 2 + ie[1];
+- const char *rsn_ie_data;
+- len = 2 + ie[1];
- rsn_ie_data = (const char *) &ie;
-+ rsn_ie_data = (const char *) ie;
if (!wpa_dbus_dict_append_byte_array(&iter_dict, "rsnie",
- rsn_ie_data, len))
+- rsn_ie_data, len))
++ (const char *) ie,
++ ie[1] + 2))
goto error;
+ }
+
More information about the Pkg-wpa-devel
mailing list