diff --git a/src/NetworkManager.conf b/src/NetworkManager.conf index 01dfee2590..5f804f9958 100644 --- a/src/NetworkManager.conf +++ b/src/NetworkManager.conf @@ -7,9 +7,8 @@ - - - + + send_interface="org.freedesktop.NetworkManager.PPP"/> @@ -20,9 +19,8 @@ - - - + + send_interface="org.freedesktop.NetworkManager.PPP"/> 512 diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c index e2f58f5094..73fd1ed880 100644 --- a/src/ppp-manager/nm-ppp-manager.c +++ b/src/ppp-manager/nm-ppp-manager.c @@ -136,12 +136,11 @@ constructor (GType type, GObject *object; NMPPPManagerPrivate *priv; DBusGConnection *connection; - static gboolean name_requested = FALSE; static guint32 counter = 0; object = G_OBJECT_CLASS (nm_ppp_manager_parent_class)->constructor (type, - n_construct_params, - construct_params); + n_construct_params, + construct_params); if (!object) return NULL; @@ -151,36 +150,8 @@ constructor (GType type, g_object_unref (object); return NULL; } + connection = nm_dbus_manager_get_connection (priv->dbus_manager); - - /* Only need to request bus name the first time */ - if (!name_requested) { - DBusGProxy *proxy; - gboolean success; - guint request_name_result; - GError *err = NULL; - - proxy = dbus_g_proxy_new_for_name (connection, - "org.freedesktop.DBus", - "/org/freedesktop/DBus", - "org.freedesktop.DBus"); - success = dbus_g_proxy_call (proxy, "RequestName", &err, - G_TYPE_STRING, NM_DBUS_SERVICE_PPP, - G_TYPE_UINT, 0, - G_TYPE_INVALID, - G_TYPE_UINT, &request_name_result, - G_TYPE_INVALID); - g_object_unref (proxy); - - if (!success) { - nm_warning ("Failed to acquire PPP manager service: %s", err->message); - g_object_unref (object); - return NULL; - } - - name_requested = TRUE; - } - priv->dbus_path = g_strdup_printf (NM_DBUS_PATH "/PPP/%d", counter++); dbus_g_connection_register_g_object (connection, priv->dbus_path, object); diff --git a/src/ppp-manager/nm-pppd-plugin.c b/src/ppp-manager/nm-pppd-plugin.c index 67d46d580c..34701c3499 100644 --- a/src/ppp-manager/nm-pppd-plugin.c +++ b/src/ppp-manager/nm-pppd-plugin.c @@ -30,6 +30,7 @@ #include #include +#include "NetworkManager.h" #include "nm-pppd-plugin.h" #include "nm-ppp-status.h" #include "nm-dbus-glib-types.h" @@ -319,10 +320,7 @@ plugin_init (void) /* NM passes in the object path of the corresponding PPPManager * object as the 'ipparam' argument to pppd. */ - proxy = dbus_g_proxy_new_for_name (bus, - NM_DBUS_SERVICE_PPP, - ipparam, - NM_DBUS_INTERFACE_PPP); + proxy = dbus_g_proxy_new_for_name (bus, NM_DBUS_SERVICE, ipparam, NM_DBUS_INTERFACE_PPP); dbus_g_connection_unref (bus); diff --git a/src/ppp-manager/nm-pppd-plugin.h b/src/ppp-manager/nm-pppd-plugin.h index b2acd5e5bc..95a2a18291 100644 --- a/src/ppp-manager/nm-pppd-plugin.h +++ b/src/ppp-manager/nm-pppd-plugin.h @@ -19,7 +19,6 @@ * Copyright (C) 2008 Red Hat, Inc. */ -#define NM_DBUS_SERVICE_PPP "org.freedesktop.NetworkManager.PPP" #define NM_DBUS_INTERFACE_PPP "org.freedesktop.NetworkManager.PPP" #define NM_PPP_IP4_CONFIG_INTERFACE "interface"