nm_system_device_add_ip6_link_address / debian backend
- From: j bootlab org
- To: networkmanager-list gnome org
- Subject: nm_system_device_add_ip6_link_address / debian backend
- Date: Fri, 11 Feb 2005 16:32:23 +0100
looks like the version from the redhat backend works in debian too,
and it solves the problems i had with wired devices and ipv6...
attached patch to add function to debian backend.
j
Index: src/backends/NetworkManagerDebian.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/src/backends/NetworkManagerDebian.c,v
retrieving revision 1.17
diff -u -r1.17 NetworkManagerDebian.c
--- src/backends/NetworkManagerDebian.c 10 Feb 2005 21:16:03 -0000 1.17
+++ src/backends/NetworkManagerDebian.c 11 Feb 2005 14:31:37 -0000
@@ -333,6 +333,23 @@
*/
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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]