Commit a888de7e authored by Dan Williams's avatar Dan Williams
Browse files

2005-02-10 Dan Williams <dcbw@redhat.com>

	Patch from Dave Woodhouse:
	* src/NetworkManagerSystem.h
	  src/backends/NetworkManagerDebian.c
	  src/backends/NetworkManagerGentoo.c
	  src/backends/NetworkManagerSlackware.c
		- New nm_system_device_add_ip6_link_address() function to add link-local
			address on an interface.  Stubbed in Debian, Gentoo, and Slackware.

	* src/backends/NetworkManagerRedHat.c
		- (nm_system_device_add_ip6_link_address): implement
		- (nm_system_device_flush_addresses): revert to previous behavior of
			flushing all addresses


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@432 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent c7c88af8
2005-02-10 Dan Williams <dcbw@redhat.com>
Patch from Dave Woodhouse:
* src/NetworkManagerSystem.h
src/backends/NetworkManagerDebian.c
src/backends/NetworkManagerGentoo.c
src/backends/NetworkManagerSlackware.c
- New nm_system_device_add_ip6_link_address() function to add link-local
address on an interface. Stubbed in Debian, Gentoo, and Slackware.
* src/backends/NetworkManagerRedHat.c
- (nm_system_device_add_ip6_link_address): implement
- (nm_system_device_flush_addresses): revert to previous behavior of
flushing all addresses
2005-02-10 Dan Williams <dcbw@redhat.com>
Patch from Tom Parker:
......
......@@ -2366,6 +2366,7 @@ static gboolean nm_device_activation_configure_ip (NMDevice *dev, gboolean do_on
if (success)
{
nm_system_device_add_ip6_link_address (dev);
nm_system_flush_arp_cache ();
nm_system_restart_mdns_responder ();
}
......
......@@ -45,6 +45,7 @@ void nm_system_kill_all_dhcp_daemons (void);
void nm_system_update_dns (void);
void nm_system_load_device_modules (void);
void nm_system_restart_mdns_responder (void);
void nm_system_device_add_ip6_link_address (NMDevice *dev);
/* Prototyps for system-layer network functions (ie setting IP address, etc) */
gboolean nm_system_device_set_ip4_address (NMDevice *dev, int ip4_address);
......
......@@ -325,6 +325,17 @@ void nm_system_restart_mdns_responder (void)
}
/*
* nm_system_device_add_ip6_link_address
*
* Add a default link-local IPv6 address to a device.
*
*/
void nm_system_device_add_ip6_link_address (NMDevice *dev)
{
}
/*
* nm_system_device_update_config_info
*
......
......@@ -220,6 +220,17 @@ void nm_system_restart_mdns_responder (void)
}
/*
* nm_system_device_add_ip6_link_address
*
* Add a default link-local IPv6 address to a device.
*
*/
void nm_system_device_add_ip6_link_address (NMDevice *dev)
{
}
/*
* nm_system_device_update_config_info
*
......
......@@ -114,11 +114,8 @@ void nm_system_device_flush_addresses (NMDevice *dev)
if (nm_device_is_test_device (dev))
return;
/* Remove all IP addresses for a device, but leave IPv6 local-scope addresses */
buf = g_strdup_printf ("/sbin/ip address flush dev %s scope global", nm_device_get_iface (dev));
nm_spawn_process (buf);
g_free (buf);
buf = g_strdup_printf ("/sbin/ip address flush dev %s scope site", nm_device_get_iface (dev));
/* Remove all IP addresses for a device */
buf = g_strdup_printf ("/sbin/ip address flush dev %s", nm_device_get_iface (dev));
nm_spawn_process (buf);
g_free (buf);
}
......@@ -333,6 +330,33 @@ void nm_system_restart_mdns_responder (void)
}
/*
* nm_system_device_add_ip6_link_address
*
* Add a default link-local IPv6 address to a device.
*
*/
void nm_system_device_add_ip6_link_address (NMDevice *dev)
{
char *buf;
unsigned char eui[8];
nm_device_get_hw_address(dev, eui);
memmove(eui+5, eui+3, 3);
eui[3] = 0xff;
eui[4] = 0xfe;
eui[0] ^= 2;
/* Add the default link-local IPv6 address to a device */
buf = g_strdup_printf ("/sbin/ip -6 address add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s",
eui[0], eui[1], eui[2], eui[3], eui[4], eui[5],
eui[6], eui[7], nm_device_get_iface (dev));
nm_spawn_process (buf);
g_free (buf);
}
/*
* nm_system_device_update_config_info
*
......
......@@ -185,6 +185,17 @@ void nm_system_restart_mdns_responder (void)
}
/*
* nm_system_device_add_ip6_link_address
*
* Add a default link-local IPv6 address to a device.
*
*/
void nm_system_device_add_ip6_link_address (NMDevice *dev)
{
}
/*
* nm_system_device_add_default_route_via_device
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment