Blame SOURCES/1015-local-route-fixes-rh1868982.patch

724c96
From 09c7c911d702fbe906c5c97435551416d27a2bf9 Mon Sep 17 00:00:00 2001
724c96
From: Thomas Haller <thaller@redhat.com>
724c96
Date: Tue, 21 Jul 2020 13:51:17 +0200
724c96
Subject: [PATCH 1/2] core: only expose "type unicast" routes on D-Bus
724c96
724c96
Currently, we would not mark non-unicast routes with their type, so they
724c96
would wrongly appear as unicast routes in the D-Bus API.
724c96
724c96
That is wrong. For now, just hide them.
724c96
724c96
Fixes: 5d0d13f57010 ('platform: add support for local routes')
724c96
(cherry picked from commit 5035687a7be4c67e32b4e08319f2e66c76b42212)
724c96
(cherry picked from commit cf3cff4f12e78615c18fd829b1f32eac4f607c0b)
724c96
---
724c96
 src/nm-ip4-config.c | 3 +++
724c96
 src/nm-ip6-config.c | 3 +++
724c96
 2 files changed, 6 insertions(+)
724c96
724c96
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c
724c96
index f017a3e809f4..9ad811642317 100644
724c96
--- a/src/nm-ip4-config.c
724c96
+++ b/src/nm-ip4-config.c
724c96
@@ -3227,6 +3227,9 @@ out_addresses_cached:
724c96
 
724c96
 			nm_assert (_route_valid (route));
724c96
 
724c96
+			if (route->type_coerced != nm_platform_route_type_coerce (RTN_UNICAST))
724c96
+				continue;
724c96
+
724c96
 			g_variant_builder_init (&route_builder, G_VARIANT_TYPE ("a{sv}"));
724c96
 			g_variant_builder_add (&route_builder, "{sv}",
724c96
 			                       "dest",
724c96
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c
724c96
index 1589cad004af..deb30e77d757 100644
724c96
--- a/src/nm-ip6-config.c
724c96
+++ b/src/nm-ip6-config.c
724c96
@@ -2682,6 +2682,9 @@ out_addresses_cached:
724c96
 
724c96
 			nm_assert (_route_valid (route));
724c96
 
724c96
+			if (route->type_coerced != nm_platform_route_type_coerce (RTN_UNICAST))
724c96
+				continue;
724c96
+
724c96
 			g_variant_builder_init (&route_builder, G_VARIANT_TYPE ("a{sv}"));
724c96
 			g_variant_builder_add (&route_builder, "{sv}",
724c96
 			                       "dest",
724c96
-- 
724c96
2.26.2
724c96
724c96
724c96
From 52fe9dec97eb7d57594141732694453ce2db08d5 Mon Sep 17 00:00:00 2001
724c96
From: Thomas Haller <thaller@redhat.com>
724c96
Date: Tue, 21 Jul 2020 18:06:21 +0200
724c96
Subject: [PATCH 2/2] core: fix selecting of best-default-route to consider
724c96
 only unicast routes
724c96
724c96
Fixes: 5d0d13f57010 ('platform: add support for local routes')
724c96
(cherry picked from commit 2a1bac6b8a7d107f33bbdb9d91eaf924fa67b64a)
724c96
(cherry picked from commit 99b362c9443591b2b643aa09980f1a5dd42b1f6b)
724c96
---
724c96
 src/nm-ip4-config.h | 3 ++-
724c96
 1 file changed, 2 insertions(+), 1 deletion(-)
724c96
724c96
diff --git a/src/nm-ip4-config.h b/src/nm-ip4-config.h
724c96
index dc8222fd5a7b..ea0617497607 100644
724c96
--- a/src/nm-ip4-config.h
724c96
+++ b/src/nm-ip4-config.h
724c96
@@ -83,7 +83,8 @@ nm_ip_config_best_default_route_is (const NMPObject *obj)
724c96
 	 * Note that this only considers the main routing table. */
724c96
 	return    r
724c96
 	       && NM_PLATFORM_IP_ROUTE_IS_DEFAULT (r)
724c96
-	       && nm_platform_route_table_is_main (r->table_coerced);
724c96
+	       && nm_platform_route_table_is_main (r->table_coerced)
724c96
+	       && r->type_coerced == nm_platform_route_type_coerce (1 /*RTN_UNICAST*/);
724c96
 }
724c96
 
724c96
 const NMPObject *_nm_ip_config_best_default_route_find_better (const NMPObject *obj_cur, const NMPObject *obj_cmp);
724c96
-- 
724c96
2.26.2
724c96