Commit 48fe2e28 authored by Dan Williams's avatar Dan Williams
Browse files

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
parent 41e1c3e2
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
2005-09-19 Christopher Aillon <caillon@redhat.com>
* src/nm-dbus-device.c: Don't assert when getting
......
......@@ -169,7 +169,7 @@ void nm_system_device_flush_addresses_with_iface (const char *iface)
g_return_if_fail (iface != NULL);
/* Remove all IP addresses for a device */
buf = g_strdup_printf ("/sbin/ip address flush dev %s", iface);
buf = g_strdup_printf ("/sbin/ip addr flush dev %s", iface);
nm_spawn_process (buf);
g_free (buf);
}
......@@ -407,7 +407,7 @@ void nm_system_device_add_ip6_link_address (NMDevice *dev)
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",
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));
......
......@@ -124,7 +124,7 @@ void nm_system_device_flush_addresses_with_iface (const char *iface)
g_return_if_fail (iface != NULL);
/* Remove all IP addresses for a device */
buf = g_strdup_printf ("/sbin/ip address flush dev %s", iface);
buf = g_strdup_printf ("/sbin/ip addr flush dev %s", iface);
nm_spawn_process (buf);
g_free (buf);
}
......@@ -287,7 +287,7 @@ void nm_system_device_add_ip6_link_address (NMDevice *dev)
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",
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);
......
......@@ -180,7 +180,7 @@ void nm_system_device_flush_addresses_with_iface (const char *iface)
g_return_if_fail (iface != NULL);
/* Remove all IP addresses for a device */
buf = g_strdup_printf ("/sbin/ip address flush dev %s", iface);
buf = g_strdup_printf ("/sbin/ip addr flush dev %s", iface);
nm_spawn_process (buf);
g_free (buf);
}
......@@ -341,7 +341,7 @@ void nm_system_device_add_ip6_link_address (NMDevice *dev)
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",
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);
......
......@@ -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);
}
......
......@@ -186,7 +186,7 @@ void nm_system_device_flush_addresses_with_iface (const char *iface)
g_return_if_fail (iface != NULL);
/* Remove all IP addresses for a device */
buf = g_strdup_printf ("/sbin/ip address flush dev %s", iface);
buf = g_strdup_printf ("/sbin/ip addr flush dev %s", iface);
nm_spawn_process (buf);
g_free (buf);
}
......@@ -335,7 +335,7 @@ void nm_system_device_add_ip6_link_address (NMDevice *dev)
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",
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);
......
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