[PATCH 1/2] Fix reassociate dbus method
Fionn Cleary
fionn.cleary
Fri Apr 4 06:45:26 PDT 2014
- Reassociate was only working when there was already a connect in
place, which is not how the REASSOCIATE command from the ctrl
interface works.
Signed-off-by: Fionn Cleary <fionn.cleary at streamunlimited.com>
---
wpa_supplicant/dbus/dbus_new.h | 2 ++
wpa_supplicant/dbus/dbus_new_handlers.c | 10 +++++-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/wpa_supplicant/dbus/dbus_new.h b/wpa_supplicant/dbus/dbus_new.h
index 61c480a..7aee923 100644
--- a/wpa_supplicant/dbus/dbus_new.h
+++ b/wpa_supplicant/dbus/dbus_new.h
@@ -91,6 +91,8 @@ enum wpas_dbus_bss_prop {
#define WPAS_DBUS_ERROR_IFACE_EXISTS \
WPAS_DBUS_NEW_INTERFACE ".InterfaceExists"
+#define WPAS_DBUS_ERROR_IFACE_DISABLED \
+ WPAS_DBUS_NEW_INTERFACE ".InterfaceDisabled"
#define WPAS_DBUS_ERROR_IFACE_UNKNOWN \
WPAS_DBUS_NEW_INTERFACE ".InterfaceUnknown"
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index 5380b43..1167bfb 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -1465,10 +1465,10 @@ err:
/**
- * wpas_dbus_handler_reassociate - Reassociate to current AP
+ * wpas_dbus_handler_reassociate - Reassociate
* @message: Pointer to incoming dbus message
* @wpa_s: wpa_supplicant structure for a network interface
- * Returns: NotConnected DBus error message if not connected
+ * Returns: InterfaceDisabled DBus error message if disabled
* or NULL otherwise.
*
* Handler function for "Reassociate" method call of network interface.
@@ -1476,13 +1476,13 @@ err:
DBusMessage * wpas_dbus_handler_reassociate(DBusMessage *message,
struct wpa_supplicant *wpa_s)
{
- if (wpa_s->current_ssid != NULL) {
+ if (wpa_s->wpa_state != WPA_INTERFACE_DISABLED) {
wpas_request_connection(wpa_s);
return NULL;
}
- return dbus_message_new_error(message, WPAS_DBUS_ERROR_NOT_CONNECTED,
- "This interface is not connected");
+ return dbus_message_new_error(message, WPAS_DBUS_ERROR_IFACE_DISABLED,
+ "This interface is disabled");
}
--
1.8.5.2
--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
filename=0002-Add-reassociate-command-to-dbus-doxygen.patch
More information about the Hostap
mailing list