about summary refs log tree commit diff
path: root/src/nm-ip4-config.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-06-29 22:16:54 +0200
committerMichael Biebl <biebl@debian.org>2020-06-29 22:16:54 +0200
commit238d328f69e0f4b838f361d7ddac1d6134bfd631 (patch)
tree411ff73bb36d725e3a337d2fddbccc7b074622e0 /src/nm-ip4-config.c
parente8d426c51e83b8465f9be527fd014f51443f829d (diff)
parent10ae7d8cd706062742d0cdb1803d49909aef9e06 (diff)
Update upstream source from tag 'upstream/1.25.91'
Update to upstream version '1.25.91'
with Debian dir 82448cadc1dd251ffbe44b7c339cadeb55eb776b
Diffstat (limited to 'src/nm-ip4-config.c')
-rw-r--r--src/nm-ip4-config.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c
index 0feb7b2c..62b41478 100644
--- a/src/nm-ip4-config.c
+++ b/src/nm-ip4-config.c
@@ -860,8 +860,26 @@ _nm_ip_config_merge_route_attributes (int addr_family,
 			(dst) = (dflt); \
 	} G_STMT_END
 
+	if (   (variant = nm_ip_route_get_attribute (s_route, NM_IP_ROUTE_ATTRIBUTE_TYPE))
+	    && g_variant_is_of_type (variant, G_VARIANT_TYPE_STRING)) {
+		guint8 type;
+
+		type = nm_utils_route_type_by_name (g_variant_get_string (variant, NULL));
+		nm_assert (NM_IN_SET (type,
+		                      RTN_UNICAST,
+		                      RTN_LOCAL));
+
+		r->type_coerced = nm_platform_route_type_coerce (type);
+	} else
+		r->type_coerced = nm_platform_route_type_coerce (RTN_UNICAST);
+
 	GET_ATTR (NM_IP_ROUTE_ATTRIBUTE_TABLE, table, UINT32, uint32, 0);
-	r->table_coerced = nm_platform_route_table_coerce (table ?: (route_table ?: RT_TABLE_MAIN));
+
+	if (   !table
+	    && r->type_coerced == nm_platform_route_type_coerce (RTN_LOCAL))
+		r->table_coerced = nm_platform_route_table_coerce (RT_TABLE_LOCAL);
+	else
+		r->table_coerced = nm_platform_route_table_coerce (table ?: (route_table ?: RT_TABLE_MAIN));
 
 	if (addr_family == AF_INET) {
 		guint8 scope;