Files
NetworkManager/src/NetworkManagerSystem.h
Dan Williams 214114fb2d 2008-11-07 Dan Williams <dcbw@redhat.com>
Fix deletion of VPN gateway route on DHCP renew (bgo #558133)

	* src/NetworkManagerSystem.c
	  src/NetworkManagerSystem.h
		- (nm_system_device_set_ip4_route): return the route that was added
		- (nm_system_add_ip4_vpn_gateway_route): make add_vpn_gateway_route()
			public, clean up, and return the route that was added
		- (nm_system_apply_ip4_config): remove VPN related stuff to simplify,
			since nm_system_add_ip4_vpn_gateway_route() is now available; add
			flags to allow only certain attributes of the NMIP4Config to be
			applied

	* src/nm-device.c
		- (handle_dhcp_lease_change): don't touch the DHCP4 config on failure
		- (nm_device_set_ip4_config): use nm_ip4_config_diff() to only apply
			what's really changed between the old and new configs; don't export
			the new IP4 config on failure; always send the DNS info to the
			named manager

	* src/vpn-manager/nm-vpn-connection.c
		- (device_ip4_config_changed, nm_vpn_connection_new, dispose): track the
			parent device's IP4Config and re-add the VPN gateway route when it
			changes
		- (nm_vpn_connection_ip4_config_get): add the VPN gateway route (since
			nm_system_apply_ip4_config() no longer does) and cache it for later
		- (connection_state_changed): move cleanup code to its own function
		- (vpn_cleanup): delete any previously added VPN gateway route; and
			re-apply the parent device's addresses and routes using
			nm_system_apply_ip4_config(), not nm_device_set_ip4_config()



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4277 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-07 13:57:39 +00:00

77 lines
3.3 KiB
C

/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager -- Network link manager
*
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2004 - 2008 Red Hat, Inc.
* Copyright (C) 2005 - 2008 Novell, Inc.
*/
#ifndef NETWORK_MANAGER_SYSTEM_H
#define NETWORK_MANAGER_SYSTEM_H
#include <netlink/route/rtnl.h>
#include <netlink/route/route.h>
#include <glib.h>
#include "nm-device.h"
#include "nm-ip4-config.h"
/* Prototypes for system/distribution dependent functions,
* implemented in the backend files in backends/ directory
*/
void nm_system_device_flush_ip4_routes (NMDevice *dev);
void nm_system_device_flush_ip4_routes_with_iface (const char *iface);
gboolean nm_system_replace_default_ip4_route (const char *iface,
guint32 gw,
guint32 mss);
gboolean nm_system_replace_default_ip4_route_vpn (const char *iface,
guint32 ext_gw,
guint32 int_gw,
guint32 mss,
const char *parent_iface,
guint32 parent_mss);
struct rtnl_route *nm_system_add_ip4_vpn_gateway_route (NMDevice *parent_device, NMIP4Config *vpn_config);
void nm_system_device_flush_ip4_addresses (NMDevice *dev);
void nm_system_device_flush_ip4_addresses_with_iface (const char *iface);
void nm_system_enable_loopback (void);
void nm_system_update_dns (void);
gboolean nm_system_apply_ip4_config (const char *iface,
NMIP4Config *config,
int priority,
NMIP4ConfigCompareFlags flags);
gboolean nm_system_device_set_up_down (NMDevice *dev,
gboolean up,
gboolean *no_firmware);
gboolean nm_system_device_set_up_down_with_iface (const char *iface,
gboolean up,
gboolean *no_firmware);
gboolean nm_system_device_is_up (NMDevice *device);
gboolean nm_system_device_is_up_with_iface (const char *iface);
gboolean nm_system_device_set_mtu (const char *iface, guint32 mtu);
#endif