mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-21 13:20:39 +01:00
2006-01-30 Dan Williams <dcbw@redhat.com>
* src/Makefile.am - Define LOCALSTATEDIR * src/nm-device-802-11-wireless.c - (supplicant_exec): tell wpa_ctrl_open() to stick the local control socket where we want it to * src/wpa_ctrl.[ch] - (wpa_ctrl_open): accept location to put local control socket git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1411 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
70f591d7d6
commit
8f39a2bcea
5 changed files with 23 additions and 6 deletions
12
ChangeLog
12
ChangeLog
|
|
@ -1,3 +1,15 @@
|
|||
2006-01-30 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/Makefile.am
|
||||
- Define LOCALSTATEDIR
|
||||
|
||||
* src/nm-device-802-11-wireless.c
|
||||
- (supplicant_exec): tell wpa_ctrl_open() to stick the local control
|
||||
socket where we want it to
|
||||
|
||||
* src/wpa_ctrl.[ch]
|
||||
- (wpa_ctrl_open): accept location to put local control socket
|
||||
|
||||
2006-01-30 Robert Love <rml@novell.com>
|
||||
|
||||
* src/dhcp-manager/nm-dhcp-manager.c: Pass TRUE for ignore_error in
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ NetworkManager_CPPFLAGS = \
|
|||
-DBINDIR=\"$(bindir)\" \
|
||||
-DDATADIR=\"$(datadir)\" \
|
||||
-DSYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DLOCALSTATEDIR=\"$(localstatedir)\" \
|
||||
-DARP_DEBUG
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2399,13 +2399,17 @@ supplicant_exec (NMDevice80211Wireless *self)
|
|||
static gboolean
|
||||
supplicant_interface_init (NMDevice80211Wireless *self)
|
||||
{
|
||||
#define NM_WPA_CTRL_IFACE_DIR LOCALSTATEDIR"/run/NetworkManager"
|
||||
struct wpa_ctrl * ctrl;
|
||||
char * socket_path;
|
||||
const char * iface = nm_device_get_iface (NM_DEVICE (self));
|
||||
gboolean success = FALSE;
|
||||
int tries = 0;
|
||||
|
||||
if (!(ctrl = wpa_ctrl_open (WPA_SUPPLICANT_GLOBAL_SOCKET)))
|
||||
/* Ensure our control socket directory is around */
|
||||
mkdir (NM_WPA_CTRL_IFACE_DIR, 0700);
|
||||
|
||||
if (!(ctrl = wpa_ctrl_open (WPA_SUPPLICANT_GLOBAL_SOCKET, NM_WPA_CTRL_IFACE_DIR)))
|
||||
goto exit;
|
||||
|
||||
/* wpa_cli -g/var/run/wpa_supplicant-global interface_add eth1 "" wext /var/run/wpa_supplicant */
|
||||
|
|
@ -2420,7 +2424,7 @@ supplicant_interface_init (NMDevice80211Wireless *self)
|
|||
*/
|
||||
socket_path = supplicant_get_device_socket_path (self);
|
||||
while (!self->priv->sup_ctrl && (tries++ < 10))
|
||||
self->priv->sup_ctrl = wpa_ctrl_open (socket_path);
|
||||
self->priv->sup_ctrl = wpa_ctrl_open (socket_path, NM_WPA_CTRL_IFACE_DIR);
|
||||
g_free (socket_path);
|
||||
if (!self->priv->sup_ctrl)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
#include "wpa_ctrl.h"
|
||||
/* WHACK #include "common.h" */
|
||||
|
||||
|
||||
/**
|
||||
* struct wpa_ctrl - Internal structure for control interface library
|
||||
*
|
||||
|
|
@ -50,7 +49,8 @@ struct wpa_ctrl {
|
|||
};
|
||||
|
||||
|
||||
struct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path)
|
||||
struct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path,
|
||||
const char *local_path_dir)
|
||||
{
|
||||
struct wpa_ctrl *ctrl;
|
||||
#ifndef CONFIG_CTRL_IFACE_UDP
|
||||
|
|
@ -98,7 +98,7 @@ struct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path)
|
|||
|
||||
ctrl->local.sun_family = AF_UNIX;
|
||||
snprintf(ctrl->local.sun_path, sizeof(ctrl->local.sun_path),
|
||||
"/tmp/wpa_ctrl_%d-%d", getpid(), counter++);
|
||||
"%s/wpa_ctrl_%d-%d", local_path_dir, getpid(), counter++);
|
||||
if (bind(ctrl->s, (struct sockaddr *) &ctrl->local,
|
||||
sizeof(ctrl->local)) < 0) {
|
||||
close(ctrl->s);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ extern "C" {
|
|||
* is configured in wpa_supplicant/hostapd and other programs using the control
|
||||
* interface need to use matching path configuration.
|
||||
*/
|
||||
struct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path);
|
||||
struct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path, const char *local_path_dir);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue