diff options
author | Thomas Haller <thaller@redhat.com> | 2017-08-30 19:05:38 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-09-08 11:05:04 +0200 |
commit | a0ca6070806cd62e90ae0660c4c3652606e0fbcf (patch) | |
tree | f9e2af258707caaaeed5f1f516303d1452165417 | |
parent | 546e12417a77b6550db98d974f7b5fcf9b24fa62 (diff) | |
download | NetworkManager-a0ca6070806cd62e90ae0660c4c3652606e0fbcf.tar.gz |
core: return new object from _nm_ip_config_add_obj()
Will be used later.
-rw-r--r-- | src/nm-ip4-config.c | 24 | ||||
-rw-r--r-- | src/nm-ip4-config.h | 3 | ||||
-rw-r--r-- | src/nm-ip6-config.c | 21 |
3 files changed, 33 insertions, 15 deletions
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index 01088fb7a1..bd9f9beb27 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -165,10 +165,12 @@ _nm_ip_config_add_obj (NMDedupMultiIndex *multi_idx, const NMPObject *obj_new, const NMPlatformObject *pl_new, gboolean merge, - gboolean append_force) + gboolean append_force, + const NMPObject **out_obj_new) { NMPObject obj_new_stackinit; const NMDedupMultiEntry *entry_old; + const NMDedupMultiEntry *entry_new; nm_assert (multi_idx); nm_assert (idx_type); @@ -271,15 +273,18 @@ _nm_ip_config_add_obj (NMDedupMultiIndex *multi_idx, NULL, entry_old ?: NM_DEDUP_MULTI_ENTRY_MISSING, NULL, - NULL, + &entry_new, NULL)) { nm_assert_not_reached (); + NM_SET_OUT (out_obj_new, NULL); return FALSE; } + NM_SET_OUT (out_obj_new, entry_new->obj); return TRUE; append_force_and_out: + NM_SET_OUT (out_obj_new, entry_old->obj); if (append_force) { if (nm_dedup_multi_entry_reorder (entry_old, NULL, TRUE)) return TRUE; @@ -641,7 +646,8 @@ nm_ip4_config_capture (NMDedupMultiIndex *multi_idx, NMPlatform *platform, int i plobj, NULL, FALSE, - TRUE)) + TRUE, + NULL)) nm_assert_not_reached (); } head_entry = nm_ip4_config_lookup_addresses (self); @@ -1580,7 +1586,8 @@ nm_ip4_config_replace (NMIP4Config *dst, const NMIP4Config *src, gboolean *relev ipconf_iter_src.current->obj, NULL, FALSE, - TRUE); + TRUE, + NULL); } nm_dedup_multi_index_dirty_remove_idx (dst_priv->multi_idx, &dst_priv->idx_ip4_addresses, FALSE); _notify_addresses (dst); @@ -1625,7 +1632,8 @@ nm_ip4_config_replace (NMIP4Config *dst, const NMIP4Config *src, gboolean *relev ipconf_iter_src.current->obj, NULL, FALSE, - TRUE); + TRUE, + NULL); } nm_dedup_multi_index_dirty_remove_idx (dst_priv->multi_idx, &dst_priv->idx_ip4_routes, FALSE); _notify_routes (dst); @@ -1986,7 +1994,8 @@ _add_address (NMIP4Config *self, const NMPObject *obj_new, const NMPlatformIP4Ad obj_new, (const NMPlatformObject *) new, TRUE, - FALSE)) + FALSE, + NULL)) _notify_addresses (self); } @@ -2126,7 +2135,8 @@ _add_route (NMIP4Config *self, const NMPObject *obj_new, const NMPlatformIP4Rout obj_new, (const NMPlatformObject *) new, TRUE, - FALSE)) + FALSE, + NULL)) _notify_routes (self); } diff --git a/src/nm-ip4-config.h b/src/nm-ip4-config.h index aa529b54d6..cd1392ce6d 100644 --- a/src/nm-ip4-config.h +++ b/src/nm-ip4-config.h @@ -90,7 +90,8 @@ gboolean _nm_ip_config_add_obj (NMDedupMultiIndex *multi_idx, const NMPObject *obj_new, const NMPlatformObject *pl_new, gboolean merge, - gboolean append_force); + gboolean append_force, + const NMPObject **out_obj_new); const NMDedupMultiEntry *_nm_ip_config_lookup_ip_route (const NMDedupMultiIndex *multi_idx, const NMIPConfigDedupMultiIdxType *idx_type, diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index 86d76347b1..feee1f71ca 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -439,7 +439,8 @@ nm_ip6_config_capture (NMDedupMultiIndex *multi_idx, NMPlatform *platform, int i plobj, NULL, FALSE, - TRUE)) + TRUE, + NULL)) nm_assert_not_reached (); has_addresses = TRUE; } @@ -1254,7 +1255,8 @@ nm_ip6_config_replace (NMIP6Config *dst, const NMIP6Config *src, gboolean *relev ipconf_iter_src.current->obj, NULL, FALSE, - TRUE); + TRUE, + NULL); } nm_dedup_multi_index_dirty_remove_idx (dst_priv->multi_idx, &dst_priv->idx_ip6_addresses, FALSE); _notify_addresses (dst); @@ -1299,7 +1301,8 @@ nm_ip6_config_replace (NMIP6Config *dst, const NMIP6Config *src, gboolean *relev ipconf_iter_src.current->obj, NULL, FALSE, - TRUE); + TRUE, + NULL); } nm_dedup_multi_index_dirty_remove_idx (dst_priv->multi_idx, &dst_priv->idx_ip6_routes, FALSE); _notify_routes (dst); @@ -1561,7 +1564,8 @@ nm_ip6_config_reset_addresses_ndisc (NMIP6Config *self, &obj, NULL, FALSE, - TRUE)) + TRUE, + NULL)) changed = TRUE; } @@ -1595,7 +1599,8 @@ _add_address (NMIP6Config *self, obj_new, (const NMPlatformObject *) new, TRUE, - FALSE)) + FALSE, + NULL)) _notify_addresses (self); } @@ -1788,7 +1793,8 @@ nm_ip6_config_reset_routes_ndisc (NMIP6Config *self, &obj, NULL, FALSE, - TRUE)) + TRUE, + NULL)) changed = TRUE; } @@ -1824,7 +1830,8 @@ _add_route (NMIP6Config *self, const NMPObject *obj_new, const NMPlatformIP6Rout obj_new, (const NMPlatformObject *) new, TRUE, - FALSE)) + FALSE, + NULL)) _notify_routes (self); } |