summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-07-21 13:51:17 +0200
committerThomas Haller <thaller@redhat.com>2020-07-21 13:52:26 +0200
commit5035687a7be4c67e32b4e08319f2e66c76b42212 (patch)
treee1dde14bb17db48909d7322593cb8164e10eef79
parente7d2ea95bac7702ea60370aebc99bfbd33f284af (diff)
downloadNetworkManager-5035687a7be4c67e32b4e08319f2e66c76b42212.tar.gz
core: only expose "type unicast" routes on D-Bus
Currently, we would not mark non-unicast routes with their type, so they would wrongly appear as unicast routes in the D-Bus API. That is wrong. For now, just hide them. Fixes: 5d0d13f57010 ('platform: add support for local routes')
-rw-r--r--src/nm-ip4-config.c3
-rw-r--r--src/nm-ip6-config.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c
index f017a3e809..9ad8116423 100644
--- a/src/nm-ip4-config.c
+++ b/src/nm-ip4-config.c
@@ -3227,6 +3227,9 @@ out_addresses_cached:
nm_assert (_route_valid (route));
+ if (route->type_coerced != nm_platform_route_type_coerce (RTN_UNICAST))
+ continue;
+
g_variant_builder_init (&route_builder, G_VARIANT_TYPE ("a{sv}"));
g_variant_builder_add (&route_builder, "{sv}",
"dest",
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c
index 1589cad004..deb30e77d7 100644
--- a/src/nm-ip6-config.c
+++ b/src/nm-ip6-config.c
@@ -2682,6 +2682,9 @@ out_addresses_cached:
nm_assert (_route_valid (route));
+ if (route->type_coerced != nm_platform_route_type_coerce (RTN_UNICAST))
+ continue;
+
g_variant_builder_init (&route_builder, G_VARIANT_TYPE ("a{sv}"));
g_variant_builder_add (&route_builder, "{sv}",
"dest",