From 31327b579f8bb0aefef66f54d1cd817cf842cb65 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 21 Sep 2007 16:26:56 +0000 Subject: [PATCH] 2007-09-21 Dan Williams * src/supplicant-manager/nm-supplicant-manager.c - (nm_supplicant_manager_init): poke the supplicant at startup to activate it on the system bus git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2846 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 6 ++++ .../nm-supplicant-manager.c | 35 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5150642125..f8f90a6cc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-09-21 Dan Williams + + * src/supplicant-manager/nm-supplicant-manager.c + - (nm_supplicant_manager_init): poke the supplicant at startup to + activate it on the system bus + 2007-09-20 Dan Williams * initscript/RedHat/NetworkManager.in diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index 9f524c7a9b..61ececc945 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -27,6 +27,7 @@ #include "nm-supplicant-interface.h" #include "nm-dbus-manager.h" #include "nm-supplicant-marshal.h" +#include "nm-utils.h" typedef struct { NMDBusManager * dbus_mgr; @@ -77,11 +78,21 @@ nm_supplicant_manager_get (void) return singleton; } +static void +poke_supplicant_cb (DBusGProxy *proxy, + DBusGProxyCall *call_id, + gpointer user_data) +{ + /* Ignore the response, just trying to service-activate the supplicant */ +} static void nm_supplicant_manager_init (NMSupplicantManager * self) { NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + NMDBusManager *dbus_mgr; + DBusGConnection *g_connection; + DBusGProxy *proxy; priv->dispose_has_run = FALSE; priv->state = NM_SUPPLICANT_MANAGER_STATE_DOWN; @@ -93,6 +104,30 @@ nm_supplicant_manager_init (NMSupplicantManager * self) "name-owner-changed", G_CALLBACK (nm_supplicant_manager_name_owner_changed), self); + + /* Poke the supplicant so that it gets activated by dbus system bus + * activation. + */ + dbus_mgr = nm_dbus_manager_get (); + g_connection = nm_dbus_manager_get_connection (dbus_mgr); + proxy = dbus_g_proxy_new_for_name (g_connection, + WPAS_DBUS_SERVICE, + WPAS_DBUS_PATH, + WPAS_DBUS_INTERFACE); + if (!proxy) { + nm_warning ("Error: could not init wpa_supplicant proxy"); + } else { + DBusGProxyCall *call; + const char *tmp = "ignore"; + + call = dbus_g_proxy_begin_call (proxy, "getInterface", + poke_supplicant_cb, + NULL, + NULL, + G_TYPE_STRING, tmp, + G_TYPE_INVALID); + } + g_object_unref (dbus_mgr); } static void