2004-11-16 02:41:53 +00:00
|
|
|
/* NetworkManager -- Network link manager
|
|
|
|
|
*
|
|
|
|
|
* Dan Williams <dcbw@redhat.com>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 2004 Red Hat, Inc.
|
|
|
|
|
* Copyright (C) 1996 - 1997 Yoichi Hariguchi <yoichi@fore.com>
|
|
|
|
|
* Copyright (C) January, 1998 Sergei Viznyuk <sv@phystech.com>
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <sys/socket.h>
|
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
#include <net/route.h>
|
|
|
|
|
#include <arpa/nameser.h>
|
2005-04-15 15:43:42 +00:00
|
|
|
#include <arpa/inet.h>
|
2004-11-16 02:41:53 +00:00
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <syslog.h>
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <resolv.h>
|
|
|
|
|
#include <netdb.h>
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
#include "NetworkManagerSystem.h"
|
|
|
|
|
#include "NetworkManagerDevice.h"
|
2005-04-06 16:45:48 +00:00
|
|
|
#include "NetworkManagerUtils.h"
|
2005-03-14 Ray Strode <rstrode@redhat.com>
Fourth (probably working) cut at porting to
dbus 0.30 api and new hal. This cut adds
some new logging macros to make debugging
easier.
* dispatcher-daemon/NetworkManagerDispatcher.c:
* info-daemon/NetworkmanagerInfo.c:
* info-daemon/NetworkManagerInfoPassphraseDialog.c:
* info-daemon/NetworkManagerInfoVPN.c:
* src/NetworkManager.c:
* src/NetworkManagerAP.c:
* src/NetworkManagerAPList.c:
* src/NetworkManagerDHCP.c:
* src/NetworkManagerDbus.c:
* src/NetworkManagerDevice.c:
* src/NetworkManagerPolicy.c:
* src/NetworkManagerSystem.c:
* src/NetworkManagerUtils.c:
* src/NetworkManagerWireless.c:
* src/autoip.c:
* src/nm-dbus-nm.c:
* src/backends/NetworkManagerDebian.c:
* src/backends/NetworkManagerGentoo.c:
* src/backends/NetworkManagerRedHat.c:
* src/backends/NetworkManagerSlackware.c:
use new logging macros.
* dispatcher-daemon/NetworkManagerDispatcher.c:
(nmd_dbus_filter): s/dbus_free/g_free/
* info-daemon/Makefile.am: link in utils library.
* info-daemon/NetworkmanagerInfo.c: use new logging
macros.
(nmi_dbus_get_network): don't assume enumerations
are 32-bit.
(nmi_dbus_nmi_message_handler): don't free what
doesn't belong to us.
* libnm_glib/libnm_glib.c:
(libnm_glib_get_nm_status):
(libnm_glib_init): don't free what doesn't
belong to us.
(libnm_glib_dbus): strdup result, so it doesn't get
lost when message is unref'd.
* panel-applet/NMWirelessAppletDbus.c:
(nmwa_dbus_update_devices): s/dbus_free/g_free/
* src/NetworkManager.c:
(nm_monitor_wired_link_state): request initial status
dump of all cards when we start up, instead of relying
on /sys/.../carrier.
(nm_info_handler), (nm_set_up_log_handlers):
log handlers to specify what syslog priorites
the logging macros default to.
* src/NetworkManagerAPList.c:
(nm_ap_list_populate_from_nmi):
s/dbus_free_string_array/g_strfreev/
* src/NetworkManagerDbus.c:
(nm_dbus_get_network_object):
validate d-bus message argument types.
Advance message iterator after reading argument,
prepend instead of append to GSList.
* src/NetworkManagerDevice.c:
(nm_device_probe_wired_link_status):
remove redundant /sys in /sys path. remove wrong
contents == NULL means has carrier assumption.
* src/nm-netlink-monitor.c
(nm_netlink_monitor_request_status): implement
function to ask kernel to dump interface link
status over netlink socket.
* test/*.c: s/dbus_free/g_free/
* utils/nm-utils.h:
(nm_print_backtrace): new macro to print backtrace.
(nm_get_timestamp): new macro to get sub-second precise
unix timestamp.
(nm_info), (nm_debug), (nm_warning), (nm_error):
new logging functions. nm_info just prints,
nm_debug includes timestamp and function,
nm_warning includes function, nm_error includes
backtrace and sigtrap.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@497 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-03-15 05:30:15 +00:00
|
|
|
#include "nm-utils.h"
|
2004-11-16 02:41:53 +00:00
|
|
|
|
2005-04-15 15:43:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
static gboolean nm_system_device_set_ip4_address (NMDevice *dev, int ip4_address);
|
|
|
|
|
static gboolean nm_system_device_set_ip4_address_with_iface (NMDevice *dev, const char *iface, int ip4_address);
|
|
|
|
|
|
|
|
|
|
static gboolean nm_system_device_set_ip4_ptp_address (NMDevice *dev, int ip4_ptp_address);
|
|
|
|
|
static gboolean nm_system_device_set_ip4_ptp_address_with_iface (NMDevice *dev, const char *iface, int ip4_ptp_address);
|
|
|
|
|
|
|
|
|
|
static gboolean nm_system_device_set_ip4_netmask (NMDevice *dev, int ip4_netmask);
|
|
|
|
|
static gboolean nm_system_device_set_ip4_netmask_with_iface (NMDevice *dev, const char *iface, int ip4_netmask);
|
|
|
|
|
|
|
|
|
|
static gboolean nm_system_device_set_ip4_broadcast (NMDevice *dev, int ip4_broadcast);
|
|
|
|
|
static gboolean nm_system_device_set_ip4_broadcast_with_iface (NMDevice *dev, const char *iface, int ip4_broadcast);
|
|
|
|
|
|
2005-05-04 21:23:09 +00:00
|
|
|
static gboolean nm_system_device_set_mtu (NMDevice *dev, guint16 in_mtu);
|
|
|
|
|
static gboolean nm_system_device_set_mtu_with_iface (NMDevice *dev, const char *iface, guint16 in_mtu);
|
|
|
|
|
|
2005-04-15 15:43:42 +00:00
|
|
|
static gboolean nm_system_device_set_ip4_route (NMDevice *dev, int ip4_gateway, int ip4_dest, int ip4_netmask);
|
|
|
|
|
static gboolean nm_system_device_set_ip4_route_with_iface (NMDevice *dev, const char *iface, int ip4_gateway, int ip4_dest, int ip4_netmask);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* nm_system_remove_ip4_config_nameservers
|
|
|
|
|
*
|
|
|
|
|
* Remove an IPv4 Config's nameservers from the name service.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void nm_system_remove_ip4_config_nameservers (NMNamedManager *named, NMIP4Config *config)
|
|
|
|
|
{
|
|
|
|
|
GError *error = NULL;
|
|
|
|
|
int i, len;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (config != NULL);
|
|
|
|
|
|
|
|
|
|
len = nm_ip4_config_get_num_nameservers (config);
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
|
{
|
|
|
|
|
guint id = nm_ip4_config_get_nameserver_id (config, i);
|
|
|
|
|
if ((id != 0) && !nm_named_manager_remove_nameserver_ipv4 (named, id, &error))
|
|
|
|
|
{
|
|
|
|
|
nm_warning ("Couldn't remove nameserver: %s", error->message);
|
|
|
|
|
g_clear_error (&error);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
nm_ip4_config_set_nameserver_id (config, i, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void set_nameservers (NMNamedManager *named, NMIP4Config *config)
|
|
|
|
|
{
|
|
|
|
|
GError *error = NULL;
|
|
|
|
|
int i, len;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (config != NULL);
|
|
|
|
|
|
|
|
|
|
len = nm_ip4_config_get_num_nameservers (config);
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
|
{
|
|
|
|
|
guint id;
|
|
|
|
|
guint ns_addr = nm_ip4_config_get_nameserver (config, i);
|
|
|
|
|
struct in_addr temp_addr;
|
|
|
|
|
char * nameserver;
|
|
|
|
|
|
|
|
|
|
temp_addr.s_addr = ns_addr;
|
|
|
|
|
nameserver = g_strdup (inet_ntoa (temp_addr));
|
|
|
|
|
nm_info ("Adding nameserver: %s", nameserver);
|
|
|
|
|
if ((id = nm_named_manager_add_nameserver_ipv4 (named, nameserver, &error)))
|
|
|
|
|
nm_ip4_config_set_nameserver_id (config, i, id);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
nm_warning ("Couldn't add nameserver: %s", error->message);
|
|
|
|
|
g_clear_error (&error);
|
|
|
|
|
}
|
|
|
|
|
g_free (nameserver);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* nm_system_remove_ip4_config_search_domains
|
|
|
|
|
*
|
|
|
|
|
* Remove an IPv4 Config's search domains from the name service.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void nm_system_remove_ip4_config_search_domains (NMNamedManager *named, NMIP4Config *config)
|
|
|
|
|
{
|
|
|
|
|
GError *error = NULL;
|
|
|
|
|
int i, len;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (config != NULL);
|
|
|
|
|
|
|
|
|
|
len = nm_ip4_config_get_num_domains (config);
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
|
{
|
|
|
|
|
guint id = nm_ip4_config_get_domain_id (config, i);
|
|
|
|
|
if ((id != 0) && !nm_named_manager_remove_domain_search (named, id, &error))
|
|
|
|
|
{
|
|
|
|
|
nm_warning ("Couldn't remove domain search: %s", error->message);
|
|
|
|
|
g_clear_error (&error);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
nm_ip4_config_set_domain_id (config, i, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void set_search_domains (NMNamedManager *named, NMIP4Config *config)
|
|
|
|
|
{
|
|
|
|
|
GError *error = NULL;
|
|
|
|
|
int i, len;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (config != NULL);
|
|
|
|
|
|
|
|
|
|
len = nm_ip4_config_get_num_domains (config);
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
|
{
|
|
|
|
|
const char * domain = nm_ip4_config_get_domain (config, i);
|
|
|
|
|
guint id;
|
|
|
|
|
|
|
|
|
|
nm_info ("Adding domain search: %s", domain);
|
|
|
|
|
if ((id = nm_named_manager_add_domain_search (named, domain, &error)))
|
|
|
|
|
nm_ip4_config_set_domain_id (config, i, id);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
nm_warning ("Couldn't add domain search: %s", error->message);
|
|
|
|
|
g_clear_error (&error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* nm_system_device_set_from_ip4_config
|
|
|
|
|
*
|
|
|
|
|
* Set IPv4 configuration of the device from an NMIP4Config object.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
gboolean nm_system_device_set_from_ip4_config (NMDevice *dev)
|
|
|
|
|
{
|
|
|
|
|
NMData * app_data;
|
|
|
|
|
NMIP4Config * config;
|
|
|
|
|
gboolean success = FALSE;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (dev != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
app_data = nm_device_get_app_data (dev);
|
|
|
|
|
g_return_val_if_fail (app_data != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
config = nm_device_get_ip4_config (dev);
|
|
|
|
|
g_return_val_if_fail (config != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
nm_system_delete_default_route ();
|
|
|
|
|
nm_system_device_flush_addresses (dev);
|
|
|
|
|
nm_system_device_flush_routes (dev);
|
|
|
|
|
nm_system_flush_arp_cache ();
|
|
|
|
|
|
|
|
|
|
nm_system_device_set_ip4_address (dev, nm_ip4_config_get_address (config));
|
|
|
|
|
nm_system_device_set_ip4_netmask (dev, nm_ip4_config_get_netmask (config));
|
|
|
|
|
nm_system_device_set_ip4_broadcast (dev, nm_ip4_config_get_broadcast (config));
|
|
|
|
|
sleep (1);
|
|
|
|
|
nm_system_device_set_ip4_route (dev, nm_ip4_config_get_gateway (config), 0, 0);
|
|
|
|
|
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
set_nameservers (app_data->named_manager, config);
|
|
|
|
|
set_search_domains (app_data->named_manager, config);
|
2005-04-15 15:43:42 +00:00
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* nm_system_vpn_device_set_from_ip4_config
|
|
|
|
|
*
|
|
|
|
|
* Set IPv4 configuration of a VPN device from an NMIP4Config object.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
gboolean nm_system_vpn_device_set_from_ip4_config (NMNamedManager *named, NMDevice *active_device, const char *iface, NMIP4Config *config)
|
|
|
|
|
{
|
|
|
|
|
gboolean success = FALSE;
|
|
|
|
|
NMIP4Config * ad_config = NULL;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (iface != NULL, FALSE);
|
|
|
|
|
g_return_val_if_fail (config != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
if (active_device && (ad_config = nm_device_get_ip4_config (active_device)))
|
|
|
|
|
{
|
|
|
|
|
nm_system_remove_ip4_config_nameservers (named, ad_config);
|
|
|
|
|
nm_system_remove_ip4_config_search_domains (named, ad_config);
|
|
|
|
|
nm_system_device_set_ip4_route (active_device, nm_ip4_config_get_gateway (ad_config), nm_ip4_config_get_gateway (config), 0xFFFFFFFF);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nm_system_device_set_up_down_with_iface (NULL, iface, TRUE);
|
|
|
|
|
|
|
|
|
|
nm_system_device_set_ip4_address_with_iface (NULL, iface, nm_ip4_config_get_address (config));
|
|
|
|
|
nm_system_device_set_ip4_ptp_address_with_iface (NULL, iface, nm_ip4_config_get_address (config));
|
|
|
|
|
nm_system_device_set_ip4_netmask_with_iface (NULL, iface, nm_ip4_config_get_netmask (config));
|
2005-05-04 21:23:09 +00:00
|
|
|
nm_system_device_set_mtu_with_iface (NULL, iface, 1412);
|
2005-04-15 15:43:42 +00:00
|
|
|
sleep (1);
|
|
|
|
|
nm_system_delete_default_route ();
|
|
|
|
|
nm_system_device_flush_routes_with_iface (iface);
|
|
|
|
|
nm_system_device_add_default_route_via_device_with_iface (iface);
|
|
|
|
|
|
|
|
|
|
set_nameservers (named, config);
|
|
|
|
|
set_search_domains (named, config);
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* nm_system_device_set_up_down
|
|
|
|
|
*
|
|
|
|
|
* Mark the device as up or down.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
gboolean nm_system_device_set_up_down (NMDevice *dev, gboolean up)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (dev != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
return nm_system_device_set_up_down_with_iface (dev, nm_device_get_iface (dev), up);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gboolean nm_system_device_set_up_down_with_iface (NMDevice *dev, const char *iface, gboolean up)
|
|
|
|
|
{
|
|
|
|
|
struct ifreq ifr;
|
|
|
|
|
guint32 flags = up ? IFF_UP : ~IFF_UP;
|
|
|
|
|
NMSock * sk;
|
|
|
|
|
gboolean success = FALSE;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (iface != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
if ((sk = nm_dev_sock_open (dev, DEV_GENERAL, __FUNCTION__, NULL)) == NULL)
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
/* Get flags already there */
|
|
|
|
|
memset (&ifr, 0, sizeof (struct ifreq));
|
|
|
|
|
memcpy (ifr.ifr_name, iface, strlen (iface));
|
2005-04-28 02:50:54 +00:00
|
|
|
if (ioctl (nm_dev_sock_get_fd (sk), SIOCGIFFLAGS, &ifr) == -1)
|
|
|
|
|
nm_warning ("nm_system_device_set_up_down_with_iface() could not get flags for device %s. errno = %d", iface, errno );
|
|
|
|
|
else
|
2005-04-15 15:43:42 +00:00
|
|
|
{
|
|
|
|
|
/* If the interface doesn't have those flags already, set them on it. */
|
|
|
|
|
if ((ifr.ifr_flags^flags) & IFF_UP)
|
|
|
|
|
{
|
|
|
|
|
ifr.ifr_flags &= ~IFF_UP;
|
|
|
|
|
ifr.ifr_flags |= IFF_UP & flags;
|
2005-04-28 02:50:54 +00:00
|
|
|
if (ioctl (nm_dev_sock_get_fd (sk), SIOCSIFFLAGS, &ifr) == -1)
|
2005-05-05 16:52:04 +00:00
|
|
|
{
|
|
|
|
|
if (errno != ENODEV)
|
|
|
|
|
nm_warning ("nm_system_device_set_up_down_with_iface() could not bring device %s %s. errno = %d", iface, (up ? "up" : "down"), errno);
|
|
|
|
|
}
|
2005-04-15 15:43:42 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nm_dev_sock_close (sk);
|
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* nm_system_device_set_ip4_address
|
|
|
|
|
*
|
|
|
|
|
* Set the device's IPv4 address.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
static gboolean nm_system_device_set_ip4_address (NMDevice *dev, int ip4_address)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (dev != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
return nm_system_device_set_ip4_address_with_iface (dev, nm_device_get_iface (dev), ip4_address);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean nm_system_device_set_ip4_address_with_iface (NMDevice *dev, const char *iface, int ip4_address)
|
2004-11-16 02:41:53 +00:00
|
|
|
{
|
|
|
|
|
struct ifreq ifr;
|
2005-04-06 16:45:48 +00:00
|
|
|
NMSock *sk;
|
2004-11-16 02:41:53 +00:00
|
|
|
gboolean success = FALSE;
|
|
|
|
|
struct sockaddr_in *p = (struct sockaddr_in *)&(ifr.ifr_addr);
|
|
|
|
|
|
2005-04-15 15:43:42 +00:00
|
|
|
g_return_val_if_fail (iface != NULL, FALSE);
|
2004-11-16 02:41:53 +00:00
|
|
|
|
2005-04-06 16:45:48 +00:00
|
|
|
if ((sk = nm_dev_sock_open (dev, NETWORK_CONTROL, __FUNCTION__, NULL)) == NULL)
|
2004-11-16 02:41:53 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
2005-04-15 15:43:42 +00:00
|
|
|
memset (&ifr, 0, sizeof (struct ifreq));
|
2004-11-16 02:41:53 +00:00
|
|
|
memcpy (ifr.ifr_name, iface, strlen (iface));
|
|
|
|
|
p->sin_family = AF_INET;
|
|
|
|
|
p->sin_addr.s_addr = ip4_address;
|
2005-04-06 16:45:48 +00:00
|
|
|
if (ioctl (nm_dev_sock_get_fd (sk), SIOCSIFADDR, &ifr) == -1)
|
2005-04-15 15:43:42 +00:00
|
|
|
nm_warning ("nm_system_device_set_ip4_address_by_iface (%s): failed to set IPv4 address!", iface);
|
2004-11-16 02:41:53 +00:00
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
success = TRUE;
|
2005-03-26 03:42:05 +00:00
|
|
|
nm_info ("Your IP address = %u.%u.%u.%u",
|
2004-12-05 21:28:42 +00:00
|
|
|
((unsigned char *)&ip4_address)[0], ((unsigned char *)&ip4_address)[1],
|
|
|
|
|
((unsigned char *)&ip4_address)[2], ((unsigned char *)&ip4_address)[3]);
|
2004-11-16 02:41:53 +00:00
|
|
|
}
|
|
|
|
|
|
2005-04-06 16:45:48 +00:00
|
|
|
nm_dev_sock_close (sk);
|
2004-11-16 02:41:53 +00:00
|
|
|
return (success);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-15 15:43:42 +00:00
|
|
|
/*
|
|
|
|
|
* nm_system_device_set_ip4_ptp_address
|
|
|
|
|
*
|
|
|
|
|
* Set the device's IPv4 point-to-point address.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
static gboolean nm_system_device_set_ip4_ptp_address (NMDevice *dev, int ip4_ptp_address)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (dev != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
return nm_system_device_set_ip4_ptp_address_with_iface (dev, nm_device_get_iface (dev), ip4_ptp_address);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean nm_system_device_set_ip4_ptp_address_with_iface (NMDevice *dev, const char *iface, int ip4_ptp_address)
|
2004-11-16 02:41:53 +00:00
|
|
|
{
|
|
|
|
|
struct ifreq ifr;
|
2005-04-06 16:45:48 +00:00
|
|
|
NMSock *sk;
|
2004-11-16 02:41:53 +00:00
|
|
|
gboolean success = FALSE;
|
|
|
|
|
struct sockaddr_in *p = (struct sockaddr_in *)&(ifr.ifr_addr);
|
|
|
|
|
|
2005-04-15 15:43:42 +00:00
|
|
|
g_return_val_if_fail (iface != NULL, FALSE);
|
2004-11-16 02:41:53 +00:00
|
|
|
|
2005-04-06 16:45:48 +00:00
|
|
|
if ((sk = nm_dev_sock_open (dev, NETWORK_CONTROL, __FUNCTION__, NULL)) == NULL)
|
2004-11-16 02:41:53 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
2005-04-15 15:43:42 +00:00
|
|
|
memset (&ifr, 0, sizeof (struct ifreq));
|
|
|
|
|
memcpy (ifr.ifr_name, iface, strlen (iface));
|
|
|
|
|
p->sin_family = AF_INET;
|
|
|
|
|
p->sin_port = 0;
|
|
|
|
|
p->sin_addr.s_addr = ip4_ptp_address;
|
|
|
|
|
|
|
|
|
|
if (ioctl (nm_dev_sock_get_fd (sk), SIOCSIFDSTADDR, &ifr) == -1)
|
|
|
|
|
nm_warning ("nm_system_device_set_ip4_ptp_address (%s): failed to set IPv4 point-to-point address!", iface);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
struct ifreq ifr2;
|
|
|
|
|
|
|
|
|
|
memset (&ifr2, 0, sizeof (struct ifreq));
|
|
|
|
|
memcpy (ifr2.ifr_name, iface, strlen (iface));
|
|
|
|
|
if (ioctl (nm_dev_sock_get_fd (sk), SIOCGIFFLAGS, &ifr2) >= 0)
|
|
|
|
|
{
|
|
|
|
|
memcpy (ifr2.ifr_name, iface, strlen (iface));
|
|
|
|
|
ifr2.ifr_flags |= IFF_POINTOPOINT;
|
|
|
|
|
if (ioctl (nm_dev_sock_get_fd (sk), SIOCSIFFLAGS, &ifr2) >= 0)
|
|
|
|
|
{
|
|
|
|
|
success = TRUE;
|
|
|
|
|
nm_info ("Your Point-to-Point IP address = %u.%u.%u.%u",
|
|
|
|
|
((unsigned char *)&ip4_ptp_address)[0], ((unsigned char *)&ip4_ptp_address)[1],
|
|
|
|
|
((unsigned char *)&ip4_ptp_address)[2], ((unsigned char *)&ip4_ptp_address)[3]);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
nm_warning ("nm_system_device_set_ip4_ptp_address (%s): failed to set POINTOPOINT flag on device!", iface);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
nm_warning ("nm_system_device_set_ip4_ptp_address (%s): failed to get interface flags!", iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nm_dev_sock_close (sk);
|
|
|
|
|
return (success);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* nm_system_device_set_ip4_netmask
|
|
|
|
|
*
|
|
|
|
|
* Set the IPv4 netmask on a device.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
static gboolean nm_system_device_set_ip4_netmask (NMDevice *dev, int ip4_netmask)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (dev != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
return nm_system_device_set_ip4_netmask_with_iface (dev, nm_device_get_iface (dev), ip4_netmask);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean nm_system_device_set_ip4_netmask_with_iface (NMDevice *dev, const char *iface, int ip4_netmask)
|
|
|
|
|
{
|
|
|
|
|
struct ifreq ifr;
|
|
|
|
|
NMSock *sk;
|
|
|
|
|
gboolean success = FALSE;
|
|
|
|
|
struct sockaddr_in *p = (struct sockaddr_in *)&(ifr.ifr_addr);
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (iface != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
if ((sk = nm_dev_sock_open (dev, NETWORK_CONTROL, __FUNCTION__, NULL)) == NULL)
|
|
|
|
|
return FALSE;
|
2005-04-06 16:45:48 +00:00
|
|
|
|
2005-04-15 15:43:42 +00:00
|
|
|
memset (&ifr, 0, sizeof (struct ifreq));
|
2004-11-16 02:41:53 +00:00
|
|
|
memcpy (ifr.ifr_name, iface, strlen (iface));
|
|
|
|
|
p->sin_family = AF_INET;
|
|
|
|
|
p->sin_addr.s_addr = ip4_netmask;
|
2005-04-06 16:45:48 +00:00
|
|
|
if (ioctl (nm_dev_sock_get_fd (sk), SIOCSIFNETMASK, &ifr) == -1)
|
2005-03-14 Ray Strode <rstrode@redhat.com>
Fourth (probably working) cut at porting to
dbus 0.30 api and new hal. This cut adds
some new logging macros to make debugging
easier.
* dispatcher-daemon/NetworkManagerDispatcher.c:
* info-daemon/NetworkmanagerInfo.c:
* info-daemon/NetworkManagerInfoPassphraseDialog.c:
* info-daemon/NetworkManagerInfoVPN.c:
* src/NetworkManager.c:
* src/NetworkManagerAP.c:
* src/NetworkManagerAPList.c:
* src/NetworkManagerDHCP.c:
* src/NetworkManagerDbus.c:
* src/NetworkManagerDevice.c:
* src/NetworkManagerPolicy.c:
* src/NetworkManagerSystem.c:
* src/NetworkManagerUtils.c:
* src/NetworkManagerWireless.c:
* src/autoip.c:
* src/nm-dbus-nm.c:
* src/backends/NetworkManagerDebian.c:
* src/backends/NetworkManagerGentoo.c:
* src/backends/NetworkManagerRedHat.c:
* src/backends/NetworkManagerSlackware.c:
use new logging macros.
* dispatcher-daemon/NetworkManagerDispatcher.c:
(nmd_dbus_filter): s/dbus_free/g_free/
* info-daemon/Makefile.am: link in utils library.
* info-daemon/NetworkmanagerInfo.c: use new logging
macros.
(nmi_dbus_get_network): don't assume enumerations
are 32-bit.
(nmi_dbus_nmi_message_handler): don't free what
doesn't belong to us.
* libnm_glib/libnm_glib.c:
(libnm_glib_get_nm_status):
(libnm_glib_init): don't free what doesn't
belong to us.
(libnm_glib_dbus): strdup result, so it doesn't get
lost when message is unref'd.
* panel-applet/NMWirelessAppletDbus.c:
(nmwa_dbus_update_devices): s/dbus_free/g_free/
* src/NetworkManager.c:
(nm_monitor_wired_link_state): request initial status
dump of all cards when we start up, instead of relying
on /sys/.../carrier.
(nm_info_handler), (nm_set_up_log_handlers):
log handlers to specify what syslog priorites
the logging macros default to.
* src/NetworkManagerAPList.c:
(nm_ap_list_populate_from_nmi):
s/dbus_free_string_array/g_strfreev/
* src/NetworkManagerDbus.c:
(nm_dbus_get_network_object):
validate d-bus message argument types.
Advance message iterator after reading argument,
prepend instead of append to GSList.
* src/NetworkManagerDevice.c:
(nm_device_probe_wired_link_status):
remove redundant /sys in /sys path. remove wrong
contents == NULL means has carrier assumption.
* src/nm-netlink-monitor.c
(nm_netlink_monitor_request_status): implement
function to ask kernel to dump interface link
status over netlink socket.
* test/*.c: s/dbus_free/g_free/
* utils/nm-utils.h:
(nm_print_backtrace): new macro to print backtrace.
(nm_get_timestamp): new macro to get sub-second precise
unix timestamp.
(nm_info), (nm_debug), (nm_warning), (nm_error):
new logging functions. nm_info just prints,
nm_debug includes timestamp and function,
nm_warning includes function, nm_error includes
backtrace and sigtrap.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@497 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-03-15 05:30:15 +00:00
|
|
|
nm_warning ("nm_system_device_set_ip4_netmask (%s): failed to set IPv4 netmask! errno = %s", iface, strerror (errno));
|
2004-11-16 02:41:53 +00:00
|
|
|
else
|
|
|
|
|
success = TRUE;
|
|
|
|
|
|
2005-04-06 16:45:48 +00:00
|
|
|
nm_dev_sock_close (sk);
|
2004-11-16 02:41:53 +00:00
|
|
|
return (success);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-15 15:43:42 +00:00
|
|
|
/*
|
|
|
|
|
* nm_system_device_set_ip4_broadcast
|
|
|
|
|
*
|
|
|
|
|
* Set the IPv4 broadcast address on a device.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
static gboolean nm_system_device_set_ip4_broadcast (NMDevice *dev, int ip4_broadcast)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (dev != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
return nm_system_device_set_ip4_broadcast_with_iface (dev, nm_device_get_iface (dev), ip4_broadcast);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean nm_system_device_set_ip4_broadcast_with_iface (NMDevice *dev, const char *iface, int ip4_broadcast)
|
2004-11-16 02:41:53 +00:00
|
|
|
{
|
|
|
|
|
struct ifreq ifr;
|
2005-04-06 16:45:48 +00:00
|
|
|
NMSock *sk;
|
2004-11-16 02:41:53 +00:00
|
|
|
gboolean success = FALSE;
|
|
|
|
|
struct sockaddr_in *p = (struct sockaddr_in *)&(ifr.ifr_addr);
|
|
|
|
|
|
2005-04-15 15:43:42 +00:00
|
|
|
g_return_val_if_fail (iface != NULL, FALSE);
|
2004-11-16 02:41:53 +00:00
|
|
|
|
2005-04-06 16:45:48 +00:00
|
|
|
if ((sk = nm_dev_sock_open (dev, NETWORK_CONTROL, __FUNCTION__, NULL)) == NULL)
|
2004-11-16 02:41:53 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
memset (&ifr, 0, sizeof(struct ifreq));
|
|
|
|
|
memcpy (ifr.ifr_name, iface, strlen (iface));
|
|
|
|
|
p->sin_family = AF_INET;
|
|
|
|
|
p->sin_addr.s_addr = ip4_broadcast;
|
2005-04-06 16:45:48 +00:00
|
|
|
if (ioctl (nm_dev_sock_get_fd (sk), SIOCSIFBRDADDR, &ifr) == -1)
|
2005-04-06 19:36:03 +00:00
|
|
|
nm_warning ("nm_system_device_set_ip4_netmask (%s): failed to set IPv4 broadcast address!", iface);
|
2004-11-16 02:41:53 +00:00
|
|
|
else
|
|
|
|
|
success = TRUE;
|
|
|
|
|
|
2005-04-06 16:45:48 +00:00
|
|
|
nm_dev_sock_close (sk);
|
2004-11-16 02:41:53 +00:00
|
|
|
return (success);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-15 15:43:42 +00:00
|
|
|
/*
|
|
|
|
|
* nm_system_device_set_ip4_broadcast
|
|
|
|
|
*
|
|
|
|
|
* Set the IPv4 broadcast address on a device.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
static gboolean nm_system_device_set_ip4_route (NMDevice *dev, int ip4_gateway, int ip4_dest, int ip4_netmask)
|
2004-11-16 02:41:53 +00:00
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (dev != NULL, FALSE);
|
|
|
|
|
|
2005-04-15 15:43:42 +00:00
|
|
|
return nm_system_device_set_ip4_route_with_iface (dev, nm_device_get_iface (dev), ip4_gateway, ip4_dest, ip4_netmask);
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-04 21:23:09 +00:00
|
|
|
/*
|
|
|
|
|
* nm_system_device_set_mtu
|
|
|
|
|
*
|
|
|
|
|
* Set the MTU on a device.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
static gboolean nm_system_device_set_mtu (NMDevice *dev, guint16 in_mtu)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (dev != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
return nm_system_device_set_mtu_with_iface (dev, nm_device_get_iface (dev), in_mtu);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean nm_system_device_set_mtu_with_iface (NMDevice *dev, const char *iface, guint16 in_mtu)
|
|
|
|
|
{
|
|
|
|
|
struct ifreq ifr;
|
|
|
|
|
NMSock *sk;
|
|
|
|
|
gboolean success = FALSE;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (iface != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
if ((sk = nm_dev_sock_open (dev, NETWORK_CONTROL, __FUNCTION__, NULL)) == NULL)
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
memset (&ifr, 0, sizeof (struct ifreq));
|
|
|
|
|
memcpy (ifr.ifr_name, iface, strlen (iface));
|
|
|
|
|
ifr.ifr_mtu = in_mtu;
|
|
|
|
|
if (ioctl (nm_dev_sock_get_fd (sk), SIOCSIFMTU, &ifr) == -1)
|
|
|
|
|
nm_warning ("nm_system_device_set_mtu (%s): failed to set mtu! errno = %s", iface, strerror (errno));
|
|
|
|
|
else
|
|
|
|
|
success = TRUE;
|
|
|
|
|
|
|
|
|
|
nm_dev_sock_close (sk);
|
|
|
|
|
return (success);
|
|
|
|
|
}
|
|
|
|
|
|
2005-04-15 15:43:42 +00:00
|
|
|
static gboolean nm_system_device_set_ip4_route_with_iface (NMDevice *dev, const char *iface, int ip4_gateway, int ip4_dest, int ip4_netmask)
|
|
|
|
|
{
|
|
|
|
|
NMSock * sk;
|
|
|
|
|
gboolean success = FALSE;
|
|
|
|
|
struct rtentry rtent;
|
|
|
|
|
struct sockaddr_in *p;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (iface != NULL, FALSE);
|
|
|
|
|
|
2005-04-06 16:45:48 +00:00
|
|
|
if ((sk = nm_dev_sock_open (dev, NETWORK_CONTROL, __FUNCTION__, NULL)) == NULL)
|
2004-11-16 02:41:53 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
memset (&rtent, 0, sizeof (struct rtentry));
|
|
|
|
|
p = (struct sockaddr_in *)&rtent.rt_dst;
|
|
|
|
|
p->sin_family = AF_INET;
|
2005-04-15 15:43:42 +00:00
|
|
|
p->sin_addr.s_addr = ip4_dest;
|
2004-11-16 02:41:53 +00:00
|
|
|
p = (struct sockaddr_in *)&rtent.rt_gateway;
|
|
|
|
|
p->sin_family = AF_INET;
|
2005-04-15 15:43:42 +00:00
|
|
|
p->sin_addr.s_addr = ip4_gateway;
|
2004-11-16 02:41:53 +00:00
|
|
|
p = (struct sockaddr_in *)&rtent.rt_genmask;
|
|
|
|
|
p->sin_family = AF_INET;
|
2005-04-15 15:43:42 +00:00
|
|
|
p->sin_addr.s_addr = ip4_netmask;
|
2004-11-16 02:41:53 +00:00
|
|
|
rtent.rt_dev = (char *)iface;
|
|
|
|
|
rtent.rt_metric = 1;
|
|
|
|
|
rtent.rt_window = 0;
|
2005-04-15 15:43:42 +00:00
|
|
|
rtent.rt_flags = RTF_UP | RTF_GATEWAY | (rtent.rt_window ? RTF_WINDOW : 0);
|
2004-11-16 02:41:53 +00:00
|
|
|
|
2005-04-06 16:45:48 +00:00
|
|
|
if (ioctl (nm_dev_sock_get_fd (sk), SIOCADDRT, &rtent) == -1)
|
2004-11-16 02:41:53 +00:00
|
|
|
{
|
2005-04-15 15:43:42 +00:00
|
|
|
if (errno == ENETUNREACH) /* possibly gateway is over the bridge */
|
|
|
|
|
{ /* try adding a route to gateway first */
|
|
|
|
|
struct rtentry rtent2;
|
2004-11-16 02:41:53 +00:00
|
|
|
|
|
|
|
|
memset (&rtent2, 0, sizeof(struct rtentry));
|
|
|
|
|
p = (struct sockaddr_in *)&rtent2.rt_dst;
|
|
|
|
|
p->sin_family = AF_INET;
|
|
|
|
|
p = (struct sockaddr_in *)&rtent2.rt_gateway;
|
|
|
|
|
p->sin_family = AF_INET;
|
2005-04-15 15:43:42 +00:00
|
|
|
p->sin_addr.s_addr = ip4_gateway;
|
2004-11-16 02:41:53 +00:00
|
|
|
p = (struct sockaddr_in *)&rtent2.rt_genmask;
|
|
|
|
|
p->sin_family = AF_INET;
|
|
|
|
|
p->sin_addr.s_addr = 0xffffffff;
|
|
|
|
|
rtent2.rt_dev = (char *)iface;
|
|
|
|
|
rtent2.rt_metric = 0;
|
|
|
|
|
rtent2.rt_flags = RTF_UP | RTF_HOST;
|
|
|
|
|
|
2005-04-06 16:45:48 +00:00
|
|
|
if (ioctl (nm_dev_sock_get_fd (sk), SIOCADDRT, &rtent2) == 0 )
|
2004-11-16 02:41:53 +00:00
|
|
|
{
|
2005-04-06 16:45:48 +00:00
|
|
|
if (ioctl (nm_dev_sock_get_fd (sk), SIOCADDRT, &rtent) == 0 )
|
2004-11-16 02:41:53 +00:00
|
|
|
success = TRUE;
|
|
|
|
|
else
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
nm_warning ("nm_system_device_set_ip4_route_with_iface (%s): failed to set IPv4 default route! errno = %d", iface, errno);
|
2004-11-16 02:41:53 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
nm_warning ("nm_system_device_set_ip4_route_with_iface (%s): failed to set IPv4 default route! errno = %d", iface, errno);
|
2004-11-16 02:41:53 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
success = TRUE;
|
|
|
|
|
|
2005-04-06 16:45:48 +00:00
|
|
|
nm_dev_sock_close (sk);
|
2004-11-16 02:41:53 +00:00
|
|
|
return (success);
|
|
|
|
|
}
|
|
|
|
|
|