2005-09-19 Dan Williams <dcbw@redhat.com>

* src/backends/NetworkManagerRedHat.c
      src/backends/NetworkManagerDebian.c
      src/backends/NetworkManagerSlackware.c
      src/backends/NetworkManagerGentoo.c
      src/backends/NetworkManagerSUSE.c
        - Fix invocations of "/sbin/ip address" to use short form instead


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@968 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2005-09-19 20:38:27 +00:00
parent 41e1c3e2da
commit 48fe2e2876
6 changed files with 36 additions and 9 deletions

View File

@@ -81,7 +81,7 @@ void nm_system_device_flush_addresses (NMDevice *dev)
return;
/* Remove all IP addresses for a device */
snprintf (buf, 100, "/sbin/ip address flush dev %s", nm_device_get_iface (dev));
snprintf (buf, 100, "/sbin/ip addr flush dev %s", nm_device_get_iface (dev));
nm_spawn_process (buf);
}
@@ -195,6 +195,24 @@ void nm_system_restart_mdns_responder (void)
*/
void nm_system_device_add_ip6_link_address (NMDevice *dev)
{
char *buf;
struct ether_addr hw_addr;
unsigned char eui[8];
nm_device_get_hw_address (dev, &hw_addr);
memcpy (eui, &(hw_addr.ether_addr_octet), sizeof (hw_addr.ether_addr_octet));
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 addr 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);
}