summaryrefslogtreecommitdiff
path: root/src/nm-pacrunner-manager.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-06-12 18:40:14 +0200
committerThomas Haller <thaller@redhat.com>2017-07-05 14:22:10 +0200
commit935411e5c03dcb62d5b2a85e67bf3220c75d0f5e (patch)
treea2736d05ab3424e576e250c65b44a6a16e4a861b /src/nm-pacrunner-manager.c
parent89385bd9683c521fbc85b5e452459c3d46d4528d (diff)
downloadNetworkManager-935411e5c03dcb62d5b2a85e67bf3220c75d0f5e.tar.gz
core: refactor NMIP4Config to use dedup-index for IPv4 routes
Eventually, every NMPlatformIP4Route, NMPlatformIP6Route, NMPlatformIP4Address and NMPlatformIP6Address should be shared an deduplicated via the global NMDedupMultiIndex instance. As first proof of concept, refactor NMIP4Config to track IPv4 routes via the shared multi_idx. There is later potential for improvement, when we pass (deduplicated) NMPObject instances around instead of plain NMPlatformIP4Route, which needs still a lot of comparing and cloning.
Diffstat (limited to 'src/nm-pacrunner-manager.c')
-rw-r--r--src/nm-pacrunner-manager.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nm-pacrunner-manager.c b/src/nm-pacrunner-manager.c
index 0a1cd823f4..a4c345e5d7 100644
--- a/src/nm-pacrunner-manager.c
+++ b/src/nm-pacrunner-manager.c
@@ -168,8 +168,10 @@ add_proxy_config (GVariantBuilder *proxy_data, const NMProxyConfig *proxy_config
static void
get_ip4_domains (GPtrArray *domains, NMIP4Config *ip4)
{
+ NMDedupMultiIter ipconf_iter;
char *cidr;
- int i;
+ const NMPlatformIP4Route *routes;
+ guint i;
/* Extract searches */
for (i = 0; i < nm_ip4_config_get_num_searches (ip4); i++)
@@ -189,9 +191,7 @@ get_ip4_domains (GPtrArray *domains, NMIP4Config *ip4)
g_ptr_array_add (domains, cidr);
}
- for (i = 0; i < nm_ip4_config_get_num_routes (ip4); i++) {
- const NMPlatformIP4Route *routes = nm_ip4_config_get_route (ip4, i);
-
+ nm_ip4_config_iter_ip4_route_for_each (&ipconf_iter, ip4, &routes) {
cidr = g_strdup_printf ("%s/%u",
nm_utils_inet4_ntop (routes->network, NULL),
routes->plen);