I have created a patch for this issue. The patch invokes the Introspect method 
to autostart wpa_supplicant if it is not already running.

Patch:

------


 gsupplicant/dbus.c       |   29 +++++++++++++++++++++++++++++
 gsupplicant/dbus.h       |    2 ++
 gsupplicant/supplicant.c |    3 +--
 3 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/gsupplicant/dbus.c b/gsupplicant/dbus.c
index 53c56ae..0009bc4 100644
--- a/gsupplicant/dbus.c
+++ b/gsupplicant/dbus.c
@@ -98,6 +98,35 @@ void supplicant_dbus_property_foreach(DBusMessageIter *iter,
      }
 }

+int supplicant_dbus_get_introspect(DBusConnection *connection)
+{
+     DBusMessage *message, *reply;
+     DBusError error;
+
+     message = dbus_message_new_method_call(SUPPLICANT_SERVICE,
+                             SUPPLICANT_PATH,
+                             DBUS_INTERFACE_INTROSPECTABLE,
+                             "Introspect");
+
+     if (message == NULL)
+           return 0;
+
+     dbus_error_init(&error);
+
+     reply = dbus_connection_send_with_reply_and_block(connection,
+                             message, -1, &error);
+
+     if (reply == NULL) {
+           dbus_message_unref(message);
+           return 0;
+     }
+
+     if (dbus_error_is_set(&error) == TRUE)
+           return 0;
+
+     return 1;
+}
+
 struct property_get_data {
      supplicant_dbus_property_function function;
      void *user_data;
diff --git a/gsupplicant/dbus.h b/gsupplicant/dbus.h
index 642e8b1..158212d 100644
--- a/gsupplicant/dbus.h
+++ b/gsupplicant/dbus.h
@@ -47,6 +47,8 @@ void supplicant_dbus_property_foreach(DBusMessageIter *iter,
                        supplicant_dbus_property_function function,
                                          void *user_data);

+int supplicant_dbus_get_introspect(DBusConnection *conn);
+
 int supplicant_dbus_property_get_all(const char *path, const char *interface,
                        supplicant_dbus_property_function function,
                                          void *user_data);
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 322b63d..d63616a 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -2420,8 +2420,7 @@ int g_supplicant_register(const GSupplicantCallbacks 
*callbacks)
      dbus_bus_add_match(connection, g_supplicant_rule6, NULL);
      dbus_connection_flush(connection);

-     if (dbus_bus_name_has_owner(connection,
-                             SUPPLICANT_SERVICE, NULL) == TRUE) {
+     if (supplicant_dbus_get_introspect(connection) == TRUE) {
            system_available = TRUE;
            supplicant_dbus_property_get_all(SUPPLICANT_PATH,
                                    SUPPLICANT_INTERFACE,
 ------


________________________________

From: [email protected] on behalf of Abbas, Mohamed
Sent: Mon 10/25/2010 11:39 PM
To: [email protected]
Subject: RE: [PATCH] Start wpa_supplican is service not running.







Mohamed, do you want to create a patch or should I do it?
If you know what is needed you can start on it.
Mohamed

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman



Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

www.wipro.com

<<winmail.dat>>

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to