diff --git a/src/core/nm-ip4-config.c b/src/core/nm-ip4-config.c index 3d1e489a59..b9917ac95a 100644 --- a/src/core/nm-ip4-config.c +++ b/src/core/nm-ip4-config.c @@ -512,22 +512,6 @@ _notify_routes(NMIP4Config *self) /*****************************************************************************/ -static int -sort_captured_addresses(const CList *lst_a, const CList *lst_b, gconstpointer user_data) -{ - const NMPlatformIP4Address *addr_a = - NMP_OBJECT_CAST_IP4_ADDRESS(c_list_entry(lst_a, NMDedupMultiEntry, lst_entries)->obj); - const NMPlatformIP4Address *addr_b = - NMP_OBJECT_CAST_IP4_ADDRESS(c_list_entry(lst_b, NMDedupMultiEntry, lst_entries)->obj); - - nm_assert(addr_a); - nm_assert(addr_b); - - /* Primary addresses first */ - return NM_FLAGS_HAS(addr_a->n_ifa_flags, IFA_F_SECONDARY) - - NM_FLAGS_HAS(addr_b->n_ifa_flags, IFA_F_SECONDARY); -} - NMIP4Config * nm_ip4_config_clone(const NMIP4Config *self) { @@ -559,7 +543,7 @@ nm_ip4_config_capture(NMDedupMultiIndex *multi_idx, NMPlatform *platform, int if head_entry = nm_platform_lookup_object(platform, NMP_OBJECT_TYPE_IP4_ADDRESS, ifindex); if (head_entry) { - nmp_cache_iter_for_each (&iter, head_entry, &plobj) { + nmp_cache_iter_for_each_reverse (&iter, head_entry, &plobj) { if (!_nm_ip_config_add_obj(priv->multi_idx, &priv->idx_ip4_addresses_, ifindex, @@ -571,9 +555,6 @@ nm_ip4_config_capture(NMDedupMultiIndex *multi_idx, NMPlatform *platform, int if NULL)) nm_assert_not_reached(); } - head_entry = nm_ip4_config_lookup_addresses(self); - nm_assert(head_entry); - nm_dedup_multi_head_entry_sort(head_entry, sort_captured_addresses, NULL); _notify_addresses(self); } diff --git a/src/core/nm-ip6-config.c b/src/core/nm-ip6-config.c index d2ecf1759b..65e8473749 100644 --- a/src/core/nm-ip6-config.c +++ b/src/core/nm-ip6-config.c @@ -316,7 +316,7 @@ nm_ip6_config_capture(NMDedupMultiIndex * multi_idx, head_entry = nm_platform_lookup_object(platform, NMP_OBJECT_TYPE_IP6_ADDRESS, ifindex); if (head_entry) { - nmp_cache_iter_for_each (&iter, head_entry, &plobj) { + nmp_cache_iter_for_each_reverse (&iter, head_entry, &plobj) { if (!_nm_ip_config_add_obj(priv->multi_idx, &priv->idx_ip6_addresses_, ifindex, @@ -328,11 +328,6 @@ nm_ip6_config_capture(NMDedupMultiIndex * multi_idx, NULL)) nm_assert_not_reached(); } - head_entry = nm_ip6_config_lookup_addresses(self); - nm_assert(head_entry); - nm_dedup_multi_head_entry_sort(head_entry, - sort_captured_addresses, - GINT_TO_POINTER(use_temporary)); _notify_addresses(self); }