2007-08-15 Dan Williams <dcbw@redhat.com>

* src/supplicant-manager/nm-supplicant-interface.c
		- (try_remove_iface): new function, ask wpa_supplicant to remove
			an interface
		- (nm_supplicant_interface_dispose): call try_remove_iface() when
			disposing of the NMSupplicantInterface.  Otherwise weird stuff
			happens on hotplug if wpa_supplicant doesn't tear down and readd
			the interface internally



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2699 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2007-08-15 19:55:04 +00:00
parent 6f57387033
commit f5ff2b6ca3
2 changed files with 42 additions and 0 deletions

View file

@ -1,3 +1,13 @@
2007-08-15 Dan Williams <dcbw@redhat.com>
* src/supplicant-manager/nm-supplicant-interface.c
- (try_remove_iface): new function, ask wpa_supplicant to remove
an interface
- (nm_supplicant_interface_dispose): call try_remove_iface() when
disposing of the NMSupplicantInterface. Otherwise weird stuff
happens on hotplug if wpa_supplicant doesn't tear down and readd
the interface internally
2007-08-15 Dan Williams <dcbw@redhat.com>
* src/nm-device-802-11-wireless.c

View file

@ -102,6 +102,7 @@ typedef struct
char * dev;
gboolean is_wireless;
char * object_path;
guint32 state;
NMCallStore * assoc_pcalls;
NMCallStore * other_pcalls;
@ -279,10 +280,30 @@ nm_supplicant_interface_get_property (GObject * object,
}
}
static void
try_remove_iface (DBusGConnection * g_connection,
const char * path)
{
DBusGProxy * proxy;
proxy = dbus_g_proxy_new_for_name (g_connection,
WPAS_DBUS_SERVICE,
WPAS_DBUS_PATH,
WPAS_DBUS_INTERFACE);
if (!proxy)
return;
dbus_g_proxy_call_no_reply (proxy, "removeInterface",
DBUS_TYPE_G_OBJECT_PATH, path,
G_TYPE_INVALID);
g_object_unref (proxy);
}
static void
nm_supplicant_interface_dispose (GObject *object)
{
NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object);
guint32 sm_state;
if (priv->dispose_has_run) {
/* If dispose did already run, return. */
@ -299,6 +320,13 @@ nm_supplicant_interface_dispose (GObject *object)
* reference.
*/
/* Ask wpa_supplicant to remove this interface */
sm_state = nm_supplicant_manager_get_state (priv->smgr);
if (sm_state == NM_SUPPLICANT_MANAGER_STATE_IDLE) {
try_remove_iface (nm_dbus_manager_get_connection (priv->dbus_mgr),
priv->object_path);
}
if (priv->iface_proxy)
g_object_unref (priv->iface_proxy);
@ -329,6 +357,8 @@ nm_supplicant_interface_dispose (GObject *object)
if (priv->cfg)
g_object_unref (priv->cfg);
g_free (priv->object_path);
/* Chain up to the parent class */
G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object);
}
@ -677,6 +707,8 @@ nm_supplicant_interface_add_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpoi
} else {
NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface);
priv->object_path = g_strdup (path);
priv->iface_proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr),
WPAS_DBUS_SERVICE,
path,