summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-08-31 13:01:19 +0200
committerThomas Haller <thaller@redhat.com>2017-09-08 11:05:04 +0200
commit546e12417a77b6550db98d974f7b5fcf9b24fa62 (patch)
tree7a5ede0125900fe272fd5f97a53d8ba8697d4555
parentaf1ad0eed7a9188d2b6fc0ad5035dadb729f1836 (diff)
downloadNetworkManager-546e12417a77b6550db98d974f7b5fcf9b24fa62.tar.gz
core: use _nm_ip_config_add_obj() in nm_ip4_config_replace() for routes
Avoid calling nm_dedup_multi_index_add() directly, like we do for all other places. Instead, call the wrapper _nm_ip_config_add_obj() which does some pre-precessing. In practice, the result is exactly the same (at the moment). But there should by only one way to add the route.
-rw-r--r--src/nm-ip4-config.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c
index ad939d0008..01088fb7a1 100644
--- a/src/nm-ip4-config.c
+++ b/src/nm-ip4-config.c
@@ -1619,12 +1619,13 @@ nm_ip4_config_replace (NMIP4Config *dst, const NMIP4Config *src, gboolean *relev
has_minor_changes = TRUE;
nm_dedup_multi_index_dirty_set_idx (dst_priv->multi_idx, &dst_priv->idx_ip4_routes);
nm_dedup_multi_iter_for_each (&ipconf_iter_src, head_entry_src) {
- nm_dedup_multi_index_add (dst_priv->multi_idx,
- &dst_priv->idx_ip4_routes,
- ipconf_iter_src.current->obj,
- NM_DEDUP_MULTI_IDX_MODE_APPEND_FORCE,
- NULL,
- NULL);
+ _nm_ip_config_add_obj (dst_priv->multi_idx,
+ &dst_priv->idx_ip4_routes_,
+ dst_priv->ifindex,
+ ipconf_iter_src.current->obj,
+ NULL,
+ FALSE,
+ TRUE);
}
nm_dedup_multi_index_dirty_remove_idx (dst_priv->multi_idx, &dst_priv->idx_ip4_routes, FALSE);
_notify_routes (dst);