Re: IPv6 support



On Wed, Mar 26, 2008 at 02:03:10PM -0400, Dan Williams wrote:
> On Wed, 2008-03-26 at 17:53 +0000, David Woodhouse wrote:
> > On Wed, 2008-03-26 at 13:41 -0400, Dan Williams wrote:
> > > 
> > > David could shed more light here, but I'm 95% sure that the kernel
> > > _used_ to only configure the device for IPv6 when something _else_
> > > configurated a valid LL address for the device.  NetworkManager does
> > > that, maybe some other tool is doing so?  Or maybe the kernel does it
> > > automagically now for some reason if you poke something in sysfs?
> > 
> > The kernel always did it automatically. NetworkManager removes the LL
> > address when it initialises the interface (it removes _all_ addresses).
> 
> Ah, right, that's why we add it _back_ due to the flushing.  That'll get
> better in the near term.

Are the following patches ok (first makes it only flush on ipv4, second
one remove the link-local stuff) ?

=========
# User Benoit Boissinot <benoit boissinot ens-lyon org>
Only flush ipv4 routes and ipv4 addresses

diff -r 57f0b818c7bd -r 664781c94bdf src/NetworkManagerSystem.c
--- a/src/NetworkManagerSystem.c	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/NetworkManagerSystem.c	Sat Apr 12 22:40:46 2008 -0400
@@ -417,7 +417,7 @@
 
 	sleep (1);
 
-	nm_system_device_flush_routes_with_iface (iface);
+	nm_system_device_flush_ip4_routes_with_iface (iface);
 
 	if (g_slist_length (routes) == 0) {
 		nm_system_device_replace_default_route (iface, 0, 0);
diff -r 57f0b818c7bd -r 664781c94bdf src/NetworkManagerSystem.h
--- a/src/NetworkManagerSystem.h	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/NetworkManagerSystem.h	Sat Apr 12 22:40:46 2008 -0400
@@ -35,8 +35,8 @@
 void			nm_system_init (void);
 gboolean		nm_system_device_has_active_routes			(NMDevice *dev);
 
-void			nm_system_device_flush_routes				(NMDevice *dev);
-void			nm_system_device_flush_routes_with_iface	(const char *iface);
+void			nm_system_device_flush_ip4_routes				(NMDevice *dev);
+void			nm_system_device_flush_ip4_routes_with_iface	(const char *iface);
 
 void			nm_system_device_replace_default_route      (const char *iface,
                                                              guint32 gw,
@@ -44,8 +44,8 @@
 
 void			nm_system_device_add_route_via_device_with_iface (const char *iface, const char *route);
 
-void			nm_system_device_flush_addresses			(NMDevice *dev);
-void			nm_system_device_flush_addresses_with_iface	(const char *iface);
+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_flush_loopback_routes			(void);
diff -r 57f0b818c7bd -r 664781c94bdf src/backends/NetworkManagerArch.c
--- a/src/backends/NetworkManagerArch.c	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/backends/NetworkManagerArch.c	Sat Apr 12 22:40:46 2008 -0400
@@ -94,48 +94,48 @@
 
 
 /*
- * nm_system_device_flush_addresses
+ * nm_system_device_flush_ip4_addresses
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_routes (NMDevice *dev)
+void nm_system_device_flush_ip4_routes (NMDevice *dev)
 {
-	nm_generic_device_flush_routes (dev);
+	nm_generic_device_flush_ip4_routes (dev);
 }
 
 /*
- * nm_system_device_flush_routes_with_iface
+ * nm_system_device_flush_ip4_routes_with_iface
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes_with_iface (const char *iface)
+void nm_system_device_flush_ip4_routes_with_iface (const char *iface)
 {
-	nm_generic_device_flush_routes_with_iface (iface);
+	nm_generic_device_flush_ip4_routes_with_iface (iface);
 }
 
 /*
- * nm_system_device_flush_addresses
+ * nm_system_device_flush_ip4_addresses
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses (NMDevice *dev)
+void nm_system_device_flush_ip4_addresses (NMDevice *dev)
 {
-	nm_generic_device_flush_addresses (dev);
+	nm_generic_device_flush_ip4_addresses (dev);
 }
 
 
 /*
- * nm_system_device_flush_addresses_with_iface
+ * nm_system_device_flush_ip4_addresses_with_iface
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses_with_iface (const char *iface)
+void nm_system_device_flush_ip4_addresses_with_iface (const char *iface)
 {
-	nm_generic_device_flush_addresses_with_iface (iface);
+	nm_generic_device_flush_ip4_addresses_with_iface (iface);
 }
 
 /*
@@ -243,8 +243,8 @@
 
 	error:
 	g_free (buf);
-	nm_system_device_flush_addresses (dev);
-	nm_system_device_flush_routes (dev);
+	nm_system_device_flush_ip4_addresses (dev);
+	nm_system_device_flush_ip4_routes (dev);
 	return(FALSE);
 }
 #endif
diff -r 57f0b818c7bd -r 664781c94bdf src/backends/NetworkManagerDebian.c
--- a/src/backends/NetworkManagerDebian.c	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/backends/NetworkManagerDebian.c	Sat Apr 12 22:40:46 2008 -0400
@@ -83,48 +83,48 @@
 
 
 /*
- * nm_system_device_flush_addresses
+ * nm_system_device_flush_ip4_addresses
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_routes (NMDevice *dev)
+void nm_system_device_flush_ip4_routes (NMDevice *dev)
 {
-	nm_generic_device_flush_routes (dev);
+	nm_generic_device_flush_ip4_routes (dev);
 }
 
 /*
- * nm_system_device_flush_routes_with_iface
+ * nm_system_device_flush_ip4_routes_with_iface
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes_with_iface (const char *iface)
+void nm_system_device_flush_ip4_routes_with_iface (const char *iface)
 {
-	nm_generic_device_flush_routes_with_iface (iface);
+	nm_generic_device_flush_ip4_routes_with_iface (iface);
 }
 
 /*
- * nm_system_device_flush_addresses
+ * nm_system_device_flush_ip4_addresses
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses (NMDevice *dev)
+void nm_system_device_flush_ip4_addresses (NMDevice *dev)
 {
-	nm_generic_device_flush_addresses (dev);
+	nm_generic_device_flush_ip4_addresses (dev);
 }
 
 
 /*
- * nm_system_device_flush_addresses_with_iface
+ * nm_system_device_flush_ip4_addresses_with_iface
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses_with_iface (const char *iface)
+void nm_system_device_flush_ip4_addresses_with_iface (const char *iface)
 {
-	nm_generic_device_flush_addresses_with_iface (iface);
+	nm_generic_device_flush_ip4_addresses_with_iface (iface);
 }
 
 /*
diff -r 57f0b818c7bd -r 664781c94bdf src/backends/NetworkManagerFrugalware.c
--- a/src/backends/NetworkManagerFrugalware.c	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/backends/NetworkManagerFrugalware.c	Sat Apr 12 22:40:46 2008 -0400
@@ -51,64 +51,64 @@
 }
 
 /*
- * nm_system_device_flush_routes
+ * nm_system_device_flush_ip4_routes
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes (NMDevice *dev)
+void nm_system_device_flush_ip4_routes (NMDevice *dev)
 {
 	g_return_if_fail (dev != NULL);
 
-	nm_system_device_flush_routes_with_iface (nm_device_get_iface (dev));
+	nm_system_device_flush_ip4_routes_with_iface (nm_device_get_iface (dev));
 }
 
 /*
- * nm_system_device_flush_routes_with_iface
+ * nm_system_device_flush_ip4_routes_with_iface
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes_with_iface (const char *iface)
+void nm_system_device_flush_ip4_routes_with_iface (const char *iface)
 {
 	char	*buf;
 
 	g_return_if_fail (iface != NULL);
 
 	/* Remove routing table entries */
-	buf = g_strdup_printf ("/usr/sbin/ip route flush dev %s", iface);
+	buf = g_strdup_printf ("/usr/sbin/ip -4 route flush dev %s", iface);
 	nm_spawn_process (buf);
 	g_free (buf);
 }
 
 
 /*
- * nm_system_device_flush_addresses
+ * nm_system_device_flush_ip4_addresses
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses (NMDevice *dev)
+void nm_system_device_flush_ip4_addresses (NMDevice *dev)
 {
 	g_return_if_fail (dev != NULL);
 
-	nm_system_device_flush_addresses_with_iface (nm_device_get_iface (dev));
+	nm_system_device_flush_ip4_addresses_with_iface (nm_device_get_iface (dev));
 }
 
 /*
- * nm_system_device_flush_addresses_with_iface
+ * nm_system_device_flush_ip4_addresses_with_iface
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses_with_iface (const char *iface)
+void nm_system_device_flush_ip4_addresses_with_iface (const char *iface)
 {
 	char	*buf;
 
 	g_return_if_fail (iface != NULL);
 
 	/* Remove all IP addresses for a device */
-	buf = g_strdup_printf ("/usr/sbin/ip addr flush dev %s", iface);
+	buf = g_strdup_printf ("/usr/sbin/ip -4 addr flush dev %s", iface);
 	nm_spawn_process (buf);
 	g_free (buf);
 }
@@ -253,7 +253,7 @@
  */
 void nm_system_flush_loopback_routes (void)
 {
-	nm_system_device_flush_routes_with_iface ("lo");
+	nm_system_device_flush_ip4_routes_with_iface ("lo");
 }
 
  
diff -r 57f0b818c7bd -r 664781c94bdf src/backends/NetworkManagerGeneric.c
--- a/src/backends/NetworkManagerGeneric.c	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/backends/NetworkManagerGeneric.c	Sat Apr 12 22:40:46 2008 -0400
@@ -104,64 +104,64 @@
 
 
 /*
- * nm_generic_device_flush_addresses
+ * nm_generic_device_flush_ip4_addresses
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_generic_device_flush_routes (NMDevice *dev)
+void nm_generic_device_flush_ip4_routes (NMDevice *dev)
 {
 	g_return_if_fail (dev != NULL);
 
-	nm_system_device_flush_routes_with_iface (nm_device_get_iface (dev));
+	nm_system_device_flush_ip4_routes_with_iface (nm_device_get_iface (dev));
 }
 
 /*
- * nm_generic_device_flush_routes_with_iface
+ * nm_generic_device_flush_ip4_routes_with_iface
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_generic_device_flush_routes_with_iface (const char *iface)
+void nm_generic_device_flush_ip4_routes_with_iface (const char *iface)
 {
 	char	*buf;
 
 	g_return_if_fail (iface != NULL);
 
 	/* Remove routing table entries */
-	buf = g_strdup_printf (IP_BINARY_PATH" route flush dev %s", iface);
+	buf = g_strdup_printf (IP_BINARY_PATH" -4 route flush dev %s", iface);
 	nm_spawn_process (buf);
 	g_free (buf);
 }
 
 /*
- * nm_generic_device_flush_addresses
+ * nm_generic_device_flush_ip4_addresses
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_generic_device_flush_addresses (NMDevice *dev)
+void nm_generic_device_flush_ip4_addresses (NMDevice *dev)
 {
 	g_return_if_fail (dev != NULL);
 
-	nm_system_device_flush_addresses_with_iface (nm_device_get_iface (dev));
+	nm_system_device_flush_ip4_addresses_with_iface (nm_device_get_iface (dev));
 }
 
 
 /*
- * nm_generic_device_flush_addresses_with_iface
+ * nm_generic_device_flush_ip4_addresses_with_iface
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_generic_device_flush_addresses_with_iface (const char *iface)
+void nm_generic_device_flush_ip4_addresses_with_iface (const char *iface)
 {
 	char	*buf;
 
 	g_return_if_fail (iface != NULL);
 
 	/* Remove all IP addresses for a device */
-	buf = g_strdup_printf (IP_BINARY_PATH" addr flush dev %s", iface);
+	buf = g_strdup_printf (IP_BINARY_PATH" -4 addr flush dev %s", iface);
 	nm_spawn_process (buf);
 	g_free (buf);
 }
@@ -188,7 +188,7 @@
  */
 void nm_generic_flush_loopback_routes (void)
 {
-	nm_system_device_flush_routes_with_iface ("lo");
+	nm_system_device_flush_ip4_routes_with_iface ("lo");
 }
 
 
diff -r 57f0b818c7bd -r 664781c94bdf src/backends/NetworkManagerGeneric.h
--- a/src/backends/NetworkManagerGeneric.h	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/backends/NetworkManagerGeneric.h	Sat Apr 12 22:40:46 2008 -0400
@@ -36,15 +36,15 @@
 void			nm_generic_init (void);
 gboolean		nm_generic_device_has_active_routes			(NMDevice *dev);
 
-void			nm_generic_device_flush_routes				(NMDevice *dev);
-void			nm_generic_device_flush_routes_with_iface	(const char *iface);
+void			nm_generic_device_flush_ip4_routes				(NMDevice *dev);
+void			nm_generic_device_flush_ip4_routes_with_iface	(const char *iface);
 
 void            nm_generic_device_replace_default_route (const char *iface, guint32 gw, guint32 mss);
 
 void			nm_generic_device_add_route_via_device_with_iface (const char *iface, const char *route);
 
-void			nm_generic_device_flush_addresses			(NMDevice *dev);
-void			nm_generic_device_flush_addresses_with_iface	(const char *iface);
+void			nm_generic_device_flush_ip4_addresses			(NMDevice *dev);
+void			nm_generic_device_flush_ip4_addresses_with_iface	(const char *iface);
 
 void			nm_generic_enable_loopback				(void);
 void			nm_generic_flush_loopback_routes			(void);
diff -r 57f0b818c7bd -r 664781c94bdf src/backends/NetworkManagerGentoo.c
--- a/src/backends/NetworkManagerGentoo.c	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/backends/NetworkManagerGentoo.c	Sat Apr 12 22:40:46 2008 -0400
@@ -55,25 +55,25 @@
 }
 
 /*
- * nm_system_device_flush_routes
+ * nm_system_device_flush_ip4_routes
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes (NMDevice *dev)
+void nm_system_device_flush_ip4_routes (NMDevice *dev)
 {
-	nm_generic_device_flush_routes (dev);
+	nm_generic_device_flush_ip4_routes (dev);
 }
 
 /*
- * nm_system_device_flush_routes_with_iface
+ * nm_system_device_flush_ip4_routes_with_iface
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes_with_iface (const char *iface)
+void nm_system_device_flush_ip4_routes_with_iface (const char *iface)
 {
-	nm_generic_device_flush_routes_with_iface (iface);
+	nm_generic_device_flush_ip4_routes_with_iface (iface);
 }
 
 /*
@@ -91,25 +91,25 @@
 
 
 /*
- * nm_system_device_flush_addresses
+ * nm_system_device_flush_ip4_addresses
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses (NMDevice *dev)
+void nm_system_device_flush_ip4_addresses (NMDevice *dev)
 {
-	nm_generic_device_flush_addresses (dev);
+	nm_generic_device_flush_ip4_addresses (dev);
 }
 
 /*
- * nm_system_device_flush_addresses_with_iface
+ * nm_system_device_flush_ip4_addresses_with_iface
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses_with_iface (const char *iface)
+void nm_system_device_flush_ip4_addresses_with_iface (const char *iface)
 {
-	nm_generic_device_flush_addresses_with_iface (iface);
+	nm_generic_device_flush_ip4_addresses_with_iface (iface);
 }
 
 #if 0
diff -r 57f0b818c7bd -r 664781c94bdf src/backends/NetworkManagerMandriva.c
--- a/src/backends/NetworkManagerMandriva.c	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/backends/NetworkManagerMandriva.c	Sat Apr 12 22:40:46 2008 -0400
@@ -54,26 +54,26 @@
 
 
 /*
- * nm_system_device_flush_routes
+ * nm_system_device_flush_ip4_routes
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes (NMDevice *dev)
+void nm_system_device_flush_ip4_routes (NMDevice *dev)
 {
-	nm_generic_device_flush_routes (dev);
+	nm_generic_device_flush_ip4_routes (dev);
 }
 
 
 /*
- * nm_system_device_flush_routes_with_iface
+ * nm_system_device_flush_ip4_routes_with_iface
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes_with_iface (const char *iface)
+void nm_system_device_flush_ip4_routes_with_iface (const char *iface)
 {
-	nm_generic_device_flush_routes_with_iface (iface);
+	nm_generic_device_flush_ip4_routes_with_iface (iface);
 }
 
 
@@ -118,26 +118,26 @@
 
 
 /*
- * nm_system_device_flush_addresses
+ * nm_system_device_flush_ip4_addresses
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses (NMDevice *dev)
+void nm_system_device_flush_ip4_addresses (NMDevice *dev)
 {
-	nm_generic_device_flush_addresses (dev);
+	nm_generic_device_flush_ip4_addresses (dev);
 }
 
 
 /*
- * nm_system_device_flush_addresses_with_iface
+ * nm_system_device_flush_ip4_addresses_with_iface
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses_with_iface (const char *iface)
+void nm_system_device_flush_ip4_addresses_with_iface (const char *iface)
 {
-	nm_generic_device_flush_addresses_with_iface (iface);
+	nm_generic_device_flush_ip4_addresses_with_iface (iface);
 }
 
 
diff -r 57f0b818c7bd -r 664781c94bdf src/backends/NetworkManagerPaldo.c
--- a/src/backends/NetworkManagerPaldo.c	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/backends/NetworkManagerPaldo.c	Sat Apr 12 22:40:46 2008 -0400
@@ -55,26 +55,26 @@
 
 
 /*
- * nm_system_device_flush_routes
+ * nm_system_device_flush_ip4_routes
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes (NMDevice *dev)
+void nm_system_device_flush_ip4_routes (NMDevice *dev)
 {
-	nm_generic_device_flush_routes (dev);
+	nm_generic_device_flush_ip4_routes (dev);
 }
 
 
 /*
- * nm_system_device_flush_routes_with_iface
+ * nm_system_device_flush_ip4_routes_with_iface
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes_with_iface (const char *iface)
+void nm_system_device_flush_ip4_routes_with_iface (const char *iface)
 {
-	nm_generic_device_flush_routes_with_iface (iface);
+	nm_generic_device_flush_ip4_routes_with_iface (iface);
 }
 
 
@@ -119,26 +119,26 @@
 
 
 /*
- * nm_system_device_flush_addresses
+ * nm_system_device_flush_ip4_addresses
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses (NMDevice *dev)
+void nm_system_device_flush_ip4_addresses (NMDevice *dev)
 {
-	nm_generic_device_flush_addresses (dev);
+	nm_generic_device_flush_ip4_addresses (dev);
 }
 
 
 /*
- * nm_system_device_flush_addresses_with_iface
+ * nm_system_device_flush_ip4_addresses_with_iface
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses_with_iface (const char *iface)
+void nm_system_device_flush_ip4_addresses_with_iface (const char *iface)
 {
-	nm_generic_device_flush_addresses_with_iface (iface);
+	nm_generic_device_flush_ip4_addresses_with_iface (iface);
 }
 
 
diff -r 57f0b818c7bd -r 664781c94bdf src/backends/NetworkManagerRedHat.c
--- a/src/backends/NetworkManagerRedHat.c	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/backends/NetworkManagerRedHat.c	Sat Apr 12 22:40:46 2008 -0400
@@ -52,26 +52,26 @@
 
 
 /*
- * nm_system_device_flush_routes
+ * nm_system_device_flush_ip4_routes
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes (NMDevice *dev)
+void nm_system_device_flush_ip4_routes (NMDevice *dev)
 {
-	nm_generic_device_flush_routes (dev);
+	nm_generic_device_flush_ip4_routes (dev);
 }
 
 
 /*
- * nm_system_device_flush_routes_with_iface
+ * nm_system_device_flush_ip4_routes_with_iface
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes_with_iface (const char *iface)
+void nm_system_device_flush_ip4_routes_with_iface (const char *iface)
 {
-	nm_generic_device_flush_routes_with_iface (iface);
+	nm_generic_device_flush_ip4_routes_with_iface (iface);
 }
 
 
@@ -116,26 +116,26 @@
 
 
 /*
- * nm_system_device_flush_addresses
+ * nm_system_device_flush_ip4_addresses
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses (NMDevice *dev)
+void nm_system_device_flush_ip4_addresses (NMDevice *dev)
 {
-	nm_generic_device_flush_addresses (dev);
+	nm_generic_device_flush_ip4_addresses (dev);
 }
 
 
 /*
- * nm_system_device_flush_addresses_with_iface
+ * nm_system_device_flush_ip4_addresses_with_iface
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses_with_iface (const char *iface)
+void nm_system_device_flush_ip4_addresses_with_iface (const char *iface)
 {
-	nm_generic_device_flush_addresses_with_iface (iface);
+	nm_generic_device_flush_ip4_addresses_with_iface (iface);
 }
 
 
diff -r 57f0b818c7bd -r 664781c94bdf src/backends/NetworkManagerSlackware.c
--- a/src/backends/NetworkManagerSlackware.c	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/backends/NetworkManagerSlackware.c	Sat Apr 12 22:40:46 2008 -0400
@@ -54,48 +54,48 @@
 }
 
 /*
- * nm_system_device_flush_routes
+ * nm_system_device_flush_ip4_routes
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes (NMDevice *dev)
+void nm_system_device_flush_ip4_routes (NMDevice *dev)
 {
-	nm_generic_device_flush_routes (dev);
+	nm_generic_device_flush_ip4_routes (dev);
 }
 
 /*
- * nm_system_device_flush_routes_with_iface
+ * nm_system_device_flush_ip4_routes_with_iface
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes_with_iface (const char *iface)
+void nm_system_device_flush_ip4_routes_with_iface (const char *iface)
 {
-	nm_generic_device_flush_routes_with_iface (iface);
+	nm_generic_device_flush_ip4_routes_with_iface (iface);
 }
 
 
 /*
- * nm_system_device_flush_addresses
+ * nm_system_device_flush_ip4_addresses
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses (NMDevice *dev)
+void nm_system_device_flush_ip4_addresses (NMDevice *dev)
 {
-	nm_generic_device_flush_addresses (dev);
+	nm_generic_device_flush_ip4_addresses (dev);
 }
 
 /*
- * nm_system_device_flush_addresses_with_iface
+ * nm_system_device_flush_ip4_addresses_with_iface
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses_with_iface (const char *iface)
+void nm_system_device_flush_ip4_addresses_with_iface (const char *iface)
 {
-	nm_generic_device_flush_addresses_with_iface (iface);
+	nm_generic_device_flush_ip4_addresses_with_iface (iface);
 }
 
 /*
diff -r 57f0b818c7bd -r 664781c94bdf src/backends/NetworkManagerSuSE.c
--- a/src/backends/NetworkManagerSuSE.c	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/backends/NetworkManagerSuSE.c	Sat Apr 12 22:40:46 2008 -0400
@@ -61,26 +61,26 @@
 
 
 /*
- * nm_system_device_flush_routes
+ * nm_system_device_flush_ip4_routes
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes (NMDevice *dev)
+void nm_system_device_flush_ip4_routes (NMDevice *dev)
 {
-	nm_generic_device_flush_routes (dev);
+	nm_generic_device_flush_ip4_routes (dev);
 }
 
 
 /*
- * nm_system_device_flush_routes_with_iface
+ * nm_system_device_flush_ip4_routes_with_iface
  *
  * Flush all routes associated with a network device
  *
  */
-void nm_system_device_flush_routes_with_iface (const char *iface)
+void nm_system_device_flush_ip4_routes_with_iface (const char *iface)
 {
-	nm_generic_device_flush_routes_with_iface (iface);
+	nm_generic_device_flush_ip4_routes_with_iface (iface);
 }
 
 
@@ -125,26 +125,26 @@
 
 
 /*
- * nm_system_device_flush_addresses
+ * nm_system_device_flush_ip4_addresses
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses (NMDevice *dev)
+void nm_system_device_flush_ip4_addresses (NMDevice *dev)
 {
-	nm_generic_device_flush_addresses (dev);
+	nm_generic_device_flush_ip4_addresses (dev);
 }
 
 
 /*
- * nm_system_device_flush_addresses_with_iface
+ * nm_system_device_flush_ip4_addresses_with_iface
  *
  * Flush all network addresses associated with a network device
  *
  */
-void nm_system_device_flush_addresses_with_iface (const char *iface)
+void nm_system_device_flush_ip4_addresses_with_iface (const char *iface)
 {
-	nm_generic_device_flush_addresses_with_iface (iface);
+	nm_generic_device_flush_ip4_addresses_with_iface (iface);
 }
 
 
diff -r 57f0b818c7bd -r 664781c94bdf src/nm-device.c
--- a/src/nm-device.c	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/nm-device.c	Sat Apr 12 22:40:46 2008 -0400
@@ -1051,8 +1051,8 @@
 	nm_device_set_ip4_config (self, NULL);
 
 	/* Take out any entries in the routing table and any IP address the device had. */
-	nm_system_device_flush_routes (self);
-	nm_system_device_flush_addresses (self);
+	nm_system_device_flush_ip4_routes (self);
+	nm_system_device_flush_ip4_addresses (self);
 	nm_device_update_ip4_address (self);	
 
 	/* Call device type-specific deactivation */
diff -r 57f0b818c7bd -r 664781c94bdf src/vpn-manager/nm-vpn-connection.c
--- a/src/vpn-manager/nm-vpn-connection.c	Sat Apr 12 22:34:50 2008 -0400
+++ b/src/vpn-manager/nm-vpn-connection.c	Sat Apr 12 22:40:46 2008 -0400
@@ -745,8 +745,8 @@
 
 		if (priv->tundev) {
 			nm_system_device_set_up_down_with_iface (priv->tundev, FALSE);
-			nm_system_device_flush_routes_with_iface (priv->tundev);
-			nm_system_device_flush_addresses_with_iface (priv->tundev);
+			nm_system_device_flush_ip4_routes_with_iface (priv->tundev);
+			nm_system_device_flush_ip4_addresses_with_iface (priv->tundev);
 		}
 
 		if (priv->ip4_config) {




========
# User Benoit Boissinot <benoit boissinot ens-lyon org>
do not add an ipv6 link local address

diff -r 664781c94bdf -r fd5d2eb7cec0 src/NetworkManagerSystem.h
--- a/src/NetworkManagerSystem.h	Sat Apr 12 22:40:46 2008 -0400
+++ b/src/NetworkManagerSystem.h	Sat Apr 12 23:08:02 2008 -0400
@@ -53,7 +53,6 @@
 void			nm_system_kill_all_dhcp_daemons			(void);
 void			nm_system_update_dns					(void);
 void			nm_system_restart_mdns_responder			(void);
-void			nm_system_device_add_ip6_link_address 		(NMDevice *dev);
 
 gboolean		nm_system_device_set_from_ip4_config		(const char *iface,
 												 NMIP4Config *config,
diff -r 664781c94bdf -r fd5d2eb7cec0 src/backends/NetworkManagerArch.c
--- a/src/backends/NetworkManagerArch.c	Sat Apr 12 22:40:46 2008 -0400
+++ b/src/backends/NetworkManagerArch.c	Sat Apr 12 23:08:02 2008 -0400
@@ -331,18 +331,6 @@
 	}	
 }
 
-
-/*
- * 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_generic_device_add_ip6_link_address (dev);
-}
-
 /*
  * nm_system_activate_nis
  *
diff -r 664781c94bdf -r fd5d2eb7cec0 src/backends/NetworkManagerDebian.c
--- a/src/backends/NetworkManagerDebian.c	Sat Apr 12 22:40:46 2008 -0400
+++ b/src/backends/NetworkManagerDebian.c	Sat Apr 12 23:08:02 2008 -0400
@@ -202,18 +202,6 @@
 	nm_spawn_process ("/usr/bin/killall -q -USR1 mDNSResponder");
 }
 
-
-/*
- * 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_generic_device_add_ip6_link_address (dev);
-}
-
 /*
  * nm_system_activate_nis
  *
diff -r 664781c94bdf -r fd5d2eb7cec0 src/backends/NetworkManagerFrugalware.c
--- a/src/backends/NetworkManagerFrugalware.c	Sat Apr 12 22:40:46 2008 -0400
+++ b/src/backends/NetworkManagerFrugalware.c	Sat Apr 12 23:08:02 2008 -0400
@@ -178,38 +178,6 @@
 	}
 }
 
-
-/*
- * 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;
-	struct ether_addr hw_addr;
-	unsigned char eui[8];
-
-	if (NM_IS_DEVICE_802_3_ETHERNET (dev))
-		nm_device_802_3_ethernet_get_address (NM_DEVICE_802_3_ETHERNET (dev), &hw_addr);
-	else if (NM_IS_DEVICE_802_11_WIRELESS (dev))
-		nm_device_802_11_wireless_get_address (NM_DEVICE_802_11_WIRELESS (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 ("/usr/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);
-}
-
 /*
  * nm_system_device_add_route_via_device_with_iface
  *
diff -r 664781c94bdf -r fd5d2eb7cec0 src/backends/NetworkManagerGeneric.c
--- a/src/backends/NetworkManagerGeneric.c	Sat Apr 12 22:40:46 2008 -0400
+++ b/src/backends/NetworkManagerGeneric.c	Sat Apr 12 23:08:02 2008 -0400
@@ -238,39 +238,6 @@
 {
 }
 
-
-/*
- * nm_generic_device_add_ip6_link_address
- *
- * Add a default link-local IPv6 address to a device.
- *
- */
-void nm_generic_device_add_ip6_link_address (NMDevice *dev)
-{
-	char *buf;
-	struct ether_addr hw_addr;
-	unsigned char eui[8];
-
-	if (NM_IS_DEVICE_802_3_ETHERNET (dev))
-		nm_device_802_3_ethernet_get_address (NM_DEVICE_802_3_ETHERNET (dev), &hw_addr);
-	else if (NM_IS_DEVICE_802_11_WIRELESS (dev))
-		nm_device_802_11_wireless_get_address (NM_DEVICE_802_11_WIRELESS (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 (IP_BINARY_PATH" -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);
-}
-
 /*
  * nm_generic_set_ip4_config_from_resolv_conf
  *
diff -r 664781c94bdf -r fd5d2eb7cec0 src/backends/NetworkManagerGeneric.h
--- a/src/backends/NetworkManagerGeneric.h	Sat Apr 12 22:40:46 2008 -0400
+++ b/src/backends/NetworkManagerGeneric.h	Sat Apr 12 23:08:02 2008 -0400
@@ -52,7 +52,6 @@
 void			nm_generic_kill_all_dhcp_daemons			(void);
 void			nm_generic_update_dns					(void);
 void			nm_generic_restart_mdns_responder			(void);
-void			nm_generic_device_add_ip6_link_address 		(NMDevice *dev);
 
 void			nm_generic_set_ip4_config_from_resolv_conf (const char *filename, NMIP4Config *ip4_config);
 void *		nm_generic_device_get_system_config			(NMDevice *dev);
diff -r 664781c94bdf -r fd5d2eb7cec0 src/backends/NetworkManagerGentoo.c
--- a/src/backends/NetworkManagerGentoo.c	Sat Apr 12 22:40:46 2008 -0400
+++ b/src/backends/NetworkManagerGentoo.c	Sat Apr 12 23:08:02 2008 -0400
@@ -231,18 +231,6 @@
 #endif
 }
 
-
-/*
- * 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_generic_device_add_ip6_link_address (dev);
-}
-
 /*
  * nm_system_device_replace_default_route
  *
diff -r 664781c94bdf -r fd5d2eb7cec0 src/backends/NetworkManagerMandriva.c
--- a/src/backends/NetworkManagerMandriva.c	Sat Apr 12 22:40:46 2008 -0400
+++ b/src/backends/NetworkManagerMandriva.c	Sat Apr 12 23:08:02 2008 -0400
@@ -253,18 +253,6 @@
 #endif
 }
 
-
-/*
- * 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_generic_device_add_ip6_link_address (dev);
-}
-
 /*
  * nm_system_activate_nis
  *
diff -r 664781c94bdf -r fd5d2eb7cec0 src/backends/NetworkManagerPaldo.c
--- a/src/backends/NetworkManagerPaldo.c	Sat Apr 12 22:40:46 2008 -0400
+++ b/src/backends/NetworkManagerPaldo.c	Sat Apr 12 23:08:02 2008 -0400
@@ -216,18 +216,6 @@
 	nm_spawn_process("/etc/init.d/avahi-daemon try-restart");
 }
 
-
-/*
- * 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_generic_device_add_ip6_link_address (dev);
-}
-
 /*
  * nm_system_activate_nis
  *
diff -r 664781c94bdf -r fd5d2eb7cec0 src/backends/NetworkManagerRedHat.c
--- a/src/backends/NetworkManagerRedHat.c	Sat Apr 12 22:40:46 2008 -0400
+++ b/src/backends/NetworkManagerRedHat.c	Sat Apr 12 23:08:02 2008 -0400
@@ -240,18 +240,6 @@
 	}
 }
 
-
-/*
- * 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_generic_device_add_ip6_link_address (dev);
-}
-
 /*
  * nm_system_activate_nis
  *
diff -r 664781c94bdf -r fd5d2eb7cec0 src/backends/NetworkManagerSlackware.c
--- a/src/backends/NetworkManagerSlackware.c	Sat Apr 12 22:40:46 2008 -0400
+++ b/src/backends/NetworkManagerSlackware.c	Sat Apr 12 23:08:02 2008 -0400
@@ -158,18 +158,6 @@
 {
 }
 
-
-/*
- * 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_generic_device_add_ip6_link_address (dev);
-}
-
 /*
  * nm_system_device_add_route_via_device_with_iface
  *
diff -r 664781c94bdf -r fd5d2eb7cec0 src/backends/NetworkManagerSuSE.c
--- a/src/backends/NetworkManagerSuSE.c	Sat Apr 12 22:40:46 2008 -0400
+++ b/src/backends/NetworkManagerSuSE.c	Sat Apr 12 23:08:02 2008 -0400
@@ -235,18 +235,6 @@
 	}
 
 	fclose (fp);
-}
-
-
-/*
- * 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_generic_device_add_ip6_link_address (dev);
 }
 
 /*
diff -r 664781c94bdf -r fd5d2eb7cec0 src/nm-device.c
--- a/src/nm-device.c	Sat Apr 12 22:40:46 2008 -0400
+++ b/src/nm-device.c	Sat Apr 12 23:08:02 2008 -0400
@@ -1400,7 +1400,6 @@
 	success = nm_system_device_set_from_ip4_config (ip_iface, config, route_to_iface);
 	if (success) {
 		nm_device_update_ip4_address (self);
-		nm_system_device_add_ip6_link_address (self);
 		nm_system_set_hostname (config);
 		nm_system_activate_nis (config);
 	}

-- 
:wq


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]