diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2020-07-02 12:20:27 +0200 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2020-07-02 12:20:27 +0200 |
| commit | 486e0bef719d78ee55d2166b0bfb4fa684c09854 (patch) | |
| tree | aead4c1cc30eb61a2d9dec70f7c8339904506fad /src/nm-ip4-config.c | |
| parent | 39143df7aed46e83f8c68ea9ad6d24cfdf5a1dd8 (diff) | |
| parent | 10ae7d8cd706062742d0cdb1803d49909aef9e06 (diff) | |
Merge branch 'upstream/latest' of https://salsa.debian.org/utopia-team/network-manager into upstream/latest
Diffstat (limited to 'src/nm-ip4-config.c')
| -rw-r--r-- | src/nm-ip4-config.c | 20 |
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; |