Blame SOURCES/rh1086237-ipv6-route-matching.patch

708502
From 9a98bc74462c11e7906195d359644ca853377170 Mon Sep 17 00:00:00 2001
708502
From: Dan Winship <danw@gnome.org>
708502
Date: Tue, 29 Apr 2014 11:06:53 -0400
708502
Subject: [PATCH] core: fix connection matching with IPv6 routes (rh #1086237)
708502
708502
An IPv6 router may have sent us arbitrary routes, so don't consider
708502
them when comparing two method=auto connections.
708502
708502
(A better fix would be to look at the route lifetime, to see if it's
708502
dynamic or static, but we don't currently have that information.)
708502
708502
https://bugzilla.gnome.org/show_bug.cgi?id=729203
708502
---
708502
 src/nm-ip6-config.c | 4 ++++
708502
 1 file changed, 4 insertions(+)
708502
708502
diff -up NetworkManager-0.9.9.1/src/nm-ip6-config.c.ipv6 NetworkManager-0.9.9.1/src/nm-ip6-config.c
708502
--- NetworkManager-0.9.9.1/src/nm-ip6-config.c.ipv6	2014-05-12 08:02:40.862188963 -0400
708502
+++ NetworkManager-0.9.9.1/src/nm-ip6-config.c	2014-05-12 08:04:36.251198172 -0400
708502
@@ -430,7 +430,7 @@ nm_ip6_config_update_setting (const NMIP
708502
 	/* Routes */
708502
 	for (i = 0; i < nroutes; i++) {
708502
 		const NMPlatformIP6Route *route = nm_ip6_config_get_route (config, i);
708502
-		NMIP6Route *s_route = nm_ip6_route_new ();
708502
+		NMIP6Route *s_route;
708502
 
708502
 		/* Ignore link-local route. */
708502
 		if (IN6_IS_ADDR_LINKLOCAL (&route->network))
708502
@@ -440,6 +440,11 @@ nm_ip6_config_update_setting (const NMIP
708502
 		if (!route->plen)
708502
 			continue;
708502
 
708502
+		/* Assume all routes on 'auto' connections came from the router. */
708502
+		if (!g_strcmp0 (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO))
708502
+			continue;
708502
+
708502
+		s_route = nm_ip6_route_new ();
708502
 		nm_ip6_route_set_dest (s_route, &route->network);
708502
 		nm_ip6_route_set_prefix (s_route, route->plen);
708502
 		if (!IN6_IS_ADDR_UNSPECIFIED (&route->network))
708502
@@ -447,6 +452,7 @@ nm_ip6_config_update_setting (const NMIP
708502
 		nm_ip6_route_set_metric (s_route, route->metric);
708502
 
708502
 		nm_setting_ip6_config_add_route (setting, s_route);
708502
+		nm_ip6_route_unref (s_route);
708502
 	}
708502
 
708502
 	/* DNS */