2006-01-13 Dan Williams <dcbw@redhat.com>

* src/nm-device-802-11-wireless.c
		- (supplicant_cleanup): delete old device control sockets too
		- (supplicant_get_device_socket_path): new function to consolidate
			locations that need a path to a device's control socket


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1325 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2006-01-13 14:47:30 +00:00
parent 1ccbaff850
commit 42d050e807
2 changed files with 26 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2006-01-13 Dan Williams <dcbw@redhat.com>
* src/nm-device-802-11-wireless.c
- (supplicant_cleanup): delete old device control sockets too
- (supplicant_get_device_socket_path): new function to consolidate
locations that need a path to a device's control socket
2006-01-12 Robert Love <rml@novell.com>
* src/backends/NetworkManagerSuSE.c: Put the ppp device in the

View file

@ -2213,10 +2213,22 @@ supplicant_remove_timeout (NMDevice80211Wireless *self)
}
}
static char *
supplicant_get_device_socket_path (NMDevice80211Wireless *self)
{
const char *iface;
g_return_val_if_fail (self != NULL, NULL);
iface = nm_device_get_iface (NM_DEVICE (self));
return g_strdup_printf (WPA_SUPPLICANT_CONTROL_SOCKET "/%s", iface);
}
static void
supplicant_cleanup (NMDevice80211Wireless *self)
{
char * sock_path;
g_return_if_fail (self != NULL);
if (self->priv->sup_pid > 0)
@ -2243,8 +2255,13 @@ supplicant_cleanup (NMDevice80211Wireless *self)
supplicant_remove_timeout (self);
remove_link_timeout (self);
/* HACK: should be fixed in wpa_supplicant */
/* HACK: should be fixed in wpa_supplicant. Will likely
* require accomodations for selinux.
*/
unlink (WPA_SUPPLICANT_GLOBAL_SOCKET);
sock_path = supplicant_get_device_socket_path (self);
unlink (sock_path);
g_free (sock_path);
}
static void
@ -2432,8 +2449,7 @@ supplicant_interface_init (NMDevice80211Wireless *self)
wpa_ctrl_close (ctrl);
/* attach to interface socket */
if (!(socket_path = g_strdup_printf (WPA_SUPPLICANT_CONTROL_SOCKET "/%s", iface)))
goto exit;
socket_path = supplicant_get_device_socket_path (self);
self->priv->sup_ctrl = wpa_ctrl_open (socket_path);
g_free (socket_path);
success = TRUE;